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

feat(filters): Added decompression filter support #1080

Conversation

unpervertedkid
Copy link

@unpervertedkid unpervertedkid commented Dec 5, 2023

Implement Decompression Filters for Incoming Requests

fixes #1035

Description

This PR introduces decompression filters that can be used to automatically decompress incoming payloads. This feature supports gzip, deflate and brotli decompression.

The decompression filters use the Content-Encoding header to determine if the incoming payload is compressed, and if so, what compression algorithm was used. If the payload is not compressed, the filters act as a no-op.

The new decompression filters can be used in the same way as the existing compression filters. Here is an example usage:

let upload = warp::path("upload")
  .and(warp::post())
  .and(warp::decompression::gzip())
  .and(warp::body::bytes())
  .map(|body: bytes::Bytes| ... do something);

Changes

  • Added new decompression filter
  • Implemented gzip, deflate, and brotli decompression filters.

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.

Decompression filters
1 participant