This project is archived and is in readonly mode.
Bug in Mime::Type#parse for single media range with accept params
Reported by Joel Chippindale | October 18th, 2010 @ 11:54 AM
Mime::Type#parse doesn't split out the accept params from the media range when there is a single media range.
I.e. it incorrectly parses the valid HTTP_ACCEPTS header "/;0.9" to be "/;0.9" rather than "/"
Comments and changes to this ticket
-
Joel Chippindale October 18th, 2010 @ 12:07 PM
- Tag changed from http accepts, actionpack to http accepts, actionpack, patch
Attached patch for master
-
Piotr Sarnacki December 17th, 2010 @ 12:31 PM
- Assigned user set to Piotr Sarnacki
- Importance changed from to Low
Joel: why patch for master uses /;/ and patch for 2.3 uses ';' ?
-
Joel Chippindale February 7th, 2011 @ 12:38 PM
Piotr,
The patch for master does not use /;/, rather they both use ';'
If you look in the patch for master and for 2.3 the line is
[Mime::Type.lookup(accept_header.split(';').first)]
Or perhaps I have misunderstood your question
J.
-
Joel Chippindale February 7th, 2011 @ 12:57 PM
This is still an issue with master, here is a new version of the patch which applies cleanly to current master.
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
Tags
Referenced by
- 6183 Mime::Type.parse ignores accept-params in the HTTP_ACCEPT header It's a duplicate: https://rails.lighthouseapp.com/projec...
- 6022 Content negotiation fails for some */* headers (regression) Is covered by #5833 which includes a patch to fix.