self.NACK (reason inline) :)

On 07/11/12 10:22, [email protected] wrote:
> 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

Dies pointed out on IRC that request.path.inclue is not the best test...

(10:34:13) dkoper: That said. the code... if
request.path.include?("cimi") , does that affect GET
/api/images/random_image_id_with_cimi_in_it?format=xml ?

Looking at [1] I think using request.env["SCRIPT_NAME"] is a safer bet.
going to resend these patches now.

marios


[1] http://rack.rubyforge.org/doc/SPEC.html


> +          #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
>  
> 

Reply via email to