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

Add support for Zstandard content-type #381

Merged
merged 8 commits into from
Jul 4, 2024

Conversation

dlindenkreuz
Copy link
Contributor

Although Req has long supported Zstandard content-encoding, it does not yet support Zstandard content-type which is used for original .zst archive files (as opposed to encoding other original media types like JSON for transfer).

This PR adds automatic decompression when :ezstd is available and content-type: application/zstd is detected. It depends on an upstream change in the MIME package: elixir-plug/mime#82

@dlindenkreuz dlindenkreuz changed the title Add support for Zstandard encoding Add support for Zstandard content-type Jul 4, 2024
@dlindenkreuz dlindenkreuz marked this pull request as ready for review July 4, 2024 10:15
@wojtekmach
Copy link
Owner

Thanks for the PR, please add docs and test and this is ready to go!

lib/req/steps.ex Outdated Show resolved Hide resolved
@dlindenkreuz
Copy link
Contributor Author

Done. In the meanwhile, MIME has been updated to 2.0.6, which adds support for Zstd.

Req currently requires MIME ~> 1.6 or ~> 2.0 — should we leave a note somewhere that MIME ~> 2.0.6 is required for Zstd?

test/req/steps_test.exs Outdated Show resolved Hide resolved
@wojtekmach wojtekmach merged commit a45e402 into wojtekmach:main Jul 4, 2024
2 checks passed
@wojtekmach
Copy link
Owner

Thank you!

@dlindenkreuz dlindenkreuz deleted the dl-patch-zstd branch July 4, 2024 20:41
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