Skip to content
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

More flexible encoding configuration #1050

Merged

Conversation

hauleth
Copy link
Contributor

@hauleth hauleth commented Sep 10, 2021

This allows setting :encodings option, which is a list of potential encodings used in given application. While currently browsers support only Deflate (named gzip in header) and Brotli, there is already RFC 8878 which defines Zstd as a potential additional encoding. This approach should provide more flexibility in future when there may be more potential encodings, and adding them one by one as a separate options may scale poorly.

This allows setting `:encodings` option, which is a list of potential
encodings used in given application. While currently browsers support
only Deflate (named `gzip` in header) and Brotli, there is already RFC
8878 [1] which defines Zstd as a potential additional encoding. This
approach should provide more flexibility in future when there may be
more potential encodings, and adding them one by one as a separate
options may scale poorly.

[1]: https://datatracker.ietf.org/doc/html/rfc8878
@josevalim
Copy link
Member

LGTM! We only need tests and docs! :)

@hauleth hauleth force-pushed the ft/more-flexible-encoding-configuration branch from a1b9ba7 to f8e6047 Compare September 11, 2021 10:27
@hauleth
Copy link
Contributor Author

hauleth commented Sep 11, 2021

@josevalim added documentation and tests (it seems that the :brotli option wasn't tested at all).

@josevalim josevalim merged commit 53906f1 into elixir-plug:master Sep 11, 2021
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@hauleth hauleth deleted the ft/more-flexible-encoding-configuration branch September 11, 2021 11:34
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.

None yet

2 participants