From: marios <[email protected]>
Signed-off-by: marios <[email protected]> --- server/lib/sinatra/rack_accept.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/lib/sinatra/rack_accept.rb b/server/lib/sinatra/rack_accept.rb index 3be919c..9b915d0 100644 --- a/server/lib/sinatra/rack_accept.rb +++ b/server/lib/sinatra/rack_accept.rb @@ -79,7 +79,11 @@ module Rack end yield wants - if Deltacloud.default_frontend.name == :cimi + if request.path.include?("cimi") || Deltacloud.default_frontend.name == :cimi + #when cimi and neither json or xml defined... default to _something_ - json? + if ([:json, :xml] & accepting_formats.keys).empty? + request.env['rack-accept.formats'] = {:json=>0} + end @media_type = (accepting_formats.has_key?(:xml) ? [:xml, accepting_formats[:xml]] : nil) end if Deltacloud.respond_to? :default_frontend -- 1.7.11.7
