webmachine-ruby
webmachine-ruby copied to clipboard
Insufficient handling of Accept header
I've run across this in a number of projects so I'm adding it here as an FYI. Accept headers can contain a number of things including quoted tokens, spaces between quality and type.subtype, etc and while the spec seems to indicate that quality should go first after the type, it appears optional/unclear in subsequent examples. I don't have the time to actually put it together in a PR but maybe somebody else can. The bit that returns Mime::Whatever would need to be changed but the rest appears sound.
https://github.com/kreynolds/rails/blob/fix-broken-mime-parsing-and-ordering/actionpack/lib/action_dispatch/http/mime_type.rb#L140
Relevant previous work for improving Accept handling: #130