This project is archived and is in readonly mode.

#6183 ✓duplicate
Lance

Mime::Type.parse ignores accept-params in the HTTP_ACCEPT header

Reported by Lance | December 16th, 2010 @ 09:49 PM

In the case that a client sends only a single media-range but nevertheless includes accept-params, as in

Accept: text/xml; q=1

Mime::Type.parse fails to recognize this as the :xml mime type as parse just looks up the raw string in Mime::Type.lookup. See here: https://github.com/rails/rails/blob/2-3-stable/actionpack/lib/actio...

It does seem odd that a client would send a header like this, but we encountered it in real life. Reading the HTTP 1.1 spec http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html it seems that the header is valid.

This is in Rails 2.3.8. A patch is forthcoming.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages