Please ignore this patch, it will break (/api.xml) functionality in Firefox
browser.

On 22/02/10 13:34 +0100, [email protected] wrote:

>---
> server/libexec/lib/sinatra/respond_to.rb |    5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
>diff --git a/server/libexec/lib/sinatra/respond_to.rb 
>b/server/libexec/lib/sinatra/respond_to.rb
>index 8e54bda..a79e099 100644
>--- a/server/libexec/lib/sinatra/respond_to.rb
>+++ b/server/libexec/lib/sinatra/respond_to.rb
>@@ -237,6 +237,11 @@ module Sinatra
>       def match_accept_type(mime_types, format)
>         selected = []
>         accepted_types = mime_types.map {|type| 
> Regexp.escape(type).gsub(/\\\*/,'.*') }
>+        # Fix for Chrome:
>+        if accepted_types.include?('text/html') and 
>accepted_types.include?('application/xml')
>+          accepted_types.delete('text/html')
>+          accepted_types.insert(0, 'text/html')
>+        end
>         accepted_types.each do |at|
>           format.each do |fmt, ht, handler|
>             (selected = [fmt, ht, handler]) and break if ht.match(at)
>--
>1.6.6.2
>

-- 
--------------------------------------------------------
Michal Fojtik, [email protected], +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API: http://deltacloud.org
--------------------------------------------------------
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to