Skip to content

Conversation

@spaceone
Copy link
Contributor

@spaceone spaceone commented Oct 1, 2021

  • fix optional whitespace parsing of Accept-Language header
  • fix ignoring quality=0 values in Accept-Language
  • disallow negative quality values in Accept-Language

HTTP allows OWS between parameters:
`Accept-Language: de-DE; q=0.1, en-US; q=0.2`
`Accept-Language: en-US; q=0, de-DE; q=0.5` means that english MUST not
be selected.
`Accept-Language: en-US; q=-1` is not allowed. ignore it.
Even better would be to raise HTTP 400 Bad Request.
@bdarnell
Copy link
Member

Thanks for the contribution!

All of these changes look good, but they're the sort of thing that really should have a test (and it looks easy enough to write one).

@spaceone
Copy link
Contributor Author

@bdarnell added the tests.

@spaceone
Copy link
Contributor Author

@bdarnell anything else?
The test has been added last year.

@bdarnell
Copy link
Member

Looks good; thank you and I apologize for the lengthy delay.

@bdarnell bdarnell merged commit c7a594a into tornadoweb:master Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants