On 22/02/10 14:34 -0800, David Lutterkort wrote:
On Mon, 2010-02-22 at 13:34 +0100, mfojtik(a)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).
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"
--
--------------------------------------------------------
Michal Fojtik, mfojtik(a)redhat.com, +420 532 294 4307
Ruby / Ruby On Rails Developer
Deltacloud API:
http://deltacloud.org
--------------------------------------------------------