Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#6183

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.

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

State: duplicate
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Lance
  2. Lance
    Lance
    • Tag changed from http accepts, mime to http accepts, mime, patch

    December 16th, 2010 @ 10:01 PM

  3. Piotr Sarnacki
    Piotr Sarnacki
    • State changed from new to duplicate
    • Importance changed from to Low

    December 17th, 2010 @ 11:12 AM

  4. Lance
    Lance

    Thanks - apologies I missed the dup

    December 17th, 2010 @ 05:31 PM