Comment 3 for bug 1829042

Revision history for this message
Dan Radez (dradez) wrote :

More explanation:
The following Accept Header Values are not valid and and generate a AcceptInvalidHeader object in WebOb. Being invalid WebOb discards the header and ends up defaulting the content type to application/json which then succeeds to process.

application/json;charset=
application/json;charset
application/json,charset=utf-8
charset=utf-8;application/json

When we pass valid header syntax application/json;charset=utf-8 We get a AcceptValidHeader object in WebOb. Because this is valid syntax WebOb tries to match our explicitly defined content type application/json to the passed content type application/json;charset=utf-8. This matching happens without any processing on the header string.

application/json != application/json;charset=utf-8

Since these don't match we get exceptions that state we have passed an invalid content type and the request bails.