webmachine-ruby icon indicating copy to clipboard operation
webmachine-ruby copied to clipboard

Insufficient handling of Accept header

Open kreynolds opened this issue 10 years ago • 1 comments

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

kreynolds avatar Mar 28 '14 15:03 kreynolds

Relevant previous work for improving Accept handling: #130

ghost avatar Jun 19 '14 01:06 ghost