rails/rails — pull request #4918 by scottwb (2012-02-07 02:21:31+00:00)
Title: Fix MIME::Type.parse handling of single media with a q value

An HTTP request header like this:

Accept: text/html;q=0.9

Is valid according to the HTTP spec, but is not handled well by `Mime::Type.parse`. It is not uncommon to receive requests like this from bots and, according to one source, the PSP's browser. The failed parsing typically manifests itself as a `MissingTemplate` error.

This change fixes issue #736, which is not currently open, but should be.

The fix should be easy to also apply to 3.x branches. I'd be happy to help with that if necessary.