-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a new AcceptEncoding header, and supporting structs/enums #70
base: master
Are you sure you want to change the base?
Conversation
…lue util type, creating a basic accept_encoding header that uses QualityValue
…g header can be created from HeaderValue, moving the implementation details of QualityValue into a sealed mod
I'd like to help get this PR approved and merged. Is there anything I can do to help? |
Is the It's been almost 11 months since this was opened, and seanmonstar/warp#513 is still waiting on this as well, which is a rather important step towards not needing nginx in front of warp. |
Any progress on this? |
Would be nice to have this merged this year, as it is required for handling compression correctly. I've been using a fork until now with this, but now I want to publish crates relying on the functionality. What is the reason for this to not be accepted? |
Any progress on this? |
@seanmonstar Any chance to review this? I'm actually interesting in Accept not Accept-Encoding, but this seems to lay a solid foundation for other similar headers as per #7. |
Probably my biggest concern is around the Besides that, the design goal of porting the types in this crate has been to expose as minimal an API surface as possible, especially around internal storage, so that we can make changes for optimization purposes and not need more breaking releases. (So, not showing public fields, not giving out references to fields, but instead returning |
This seems to encapsulate most APIs behind methods pretty well, except for yeah, Not having |
Version 0.4 of |
This PR creates a new version of the
AcceptEncoding
header which is built on top of a new structQualityValue
and enumContentCoding
QualityValue
is a wrapper aroundFlatCsv
that parses the values in the csv as if they might have a quality value delimited by a default";q="
. We adhere to the spec for quality value, namely, if a value in the header doesn't have a weighting, we assign a default value of 1, and then sort equal values by order in the header (test cases are included that assert this).ContentCoding
is an enum that represents common values passed with Accept-Encoding, notably,"gzip", "deflate", "compress", "br", and "identity"
. The enum and its impls are derived via a new macro with doc tests to show behavior.