On Tue, 2010-02-23 at 13:35 +0100, Michal Fojtik wrote:
On 22/02/10 14:34 -0800, David Lutterkort wrote:
On Mon, 2010-02-22 at 13:34 +0100, mfojtik@redhat.com wrote:
This is because Chrome sending 'application/xml' mime type before 'text/html' (which is weird but standard correct). Unfortunately, we are lacking 'q' parameter handling in 'respond_to' plugin to handle this correctly...
We do .. the rack/accept_media_types gem sorts according to 'q' value. What's the Accept header that Chrome sends ?
Sure, rack/accept_media_types handles this properly (IMHO), but in some weird way it doesn't work in Chrome (Chrome sends application/xml always first, either if you request explicitly text/html (by .html).
You do get HTML though when you request it explicitly, right ?
Chrome headers:
If I request /api, Chrome sends:
"application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
If I request /api.xml, Chrome sends:
"application/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
Chrome is broken. It prefers application/xml over text/html ? See [1] for a nice rant.
David
[1] http://www.newmediacampaigns.com/page/browser-rest-http-accept-headers