Fix parsing of Accept-Encoding request header#220
Merged
Nehliin merged 5 commits intotower-rs:masterfrom Mar 2, 2022
mdickopp:accept-encoding-parsing
Merged
Fix parsing of Accept-Encoding request header#220Nehliin merged 5 commits intotower-rs:masterfrom mdickopp:accept-encoding-parsing
Accept-Encoding request header#220Nehliin merged 5 commits intotower-rs:masterfrom
mdickopp:accept-encoding-parsing
Conversation
* Add unit tests to content_encoding * Represent quality values (qvalues) by a separate type * Parse encodings case-insensitively * Parse qvalues as specified in RFC 7231 section 5.3.1 Refs: #215
Nehliin
requested changes
Feb 22, 2022
Collaborator
Nehliin
left a comment
There was a problem hiding this comment.
Thank you for your pr! Great find and sorry for the long review delay. Have had a lot of other things on my plate. I will be faster in any follow ups on this.
This syntax is not supported in rust 1.51 (the minimum toolchain version).
Nehliin
approved these changes
Feb 28, 2022
Collaborator
Nehliin
left a comment
There was a problem hiding this comment.
Great! thank you @davidpdrsn do you want to add anything?
davidpdrsn
pushed a commit
that referenced
this pull request
Mar 7, 2022
* Fix parsing of Accept-Encoding request header * Add unit tests to content_encoding * Represent quality values (qvalues) by a separate type * Parse encodings case-insensitively * Parse qvalues as specified in RFC 7231 section 5.3.1 Refs: #215 * Do not use or-pattern syntax This syntax is not supported in rust 1.51 (the minimum toolchain version). * Add comments to QValue::parse * Remove redundant SupportedEncodingsAll::new function * Add unit tests for all content-encodings (gzip, deflate, br)
Merged
davidpdrsn
added a commit
that referenced
this pull request
Mar 7, 2022
* Release 0.2.4 - Added `CatchPanic` middleware which catches panics and converts them into `500 Internal Server` responses ([#214]) [#214]: #214 * Fix parsing of `Accept-Encoding` request header (#220) * Fix parsing of Accept-Encoding request header * Add unit tests to content_encoding * Represent quality values (qvalues) by a separate type * Parse encodings case-insensitively * Parse qvalues as specified in RFC 7231 section 5.3.1 Refs: #215 * Do not use or-pattern syntax This syntax is not supported in rust 1.51 (the minimum toolchain version). * Add comments to QValue::parse * Remove redundant SupportedEncodingsAll::new function * Add unit tests for all content-encodings (gzip, deflate, br) * Update changelog * add changelog groups Co-authored-by: Martin Dickopp <martin@zero-based.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
This PR fixes some of the issues described in bug report #215, in particular those related to parsing the
Accept-Encodingheader (cases 1, 2, 3, and 5).Solution