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

Decompression filters #1035

Open
cmackenzie1 opened this issue Apr 6, 2023 · 1 comment
Open

Decompression filters #1035

cmackenzie1 opened this issue Apr 6, 2023 · 1 comment
Labels
feature New feature or request

Comments

@cmackenzie1
Copy link

Is your feature request related to a problem? Please describe.
For outgoing responses, one can use the .with(warp::compression::gzip()) to automatically encode the response. The inverse should also be possible - decompressing incoming payloads.

Looking for gzip support primarily.

Describe the solution you'd like

Ideally the very same filters for compressing outgoing responses could also be used for decompressing incoming responses. They impl should use Content-Encoding header and be a no-op if the data is not compressed. Basically, should behave like a optional middleware in a classic stack.

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

Describe alternatives you've considered
Decompressing the warp::body::bytes() manually.

Additional context
Nothing to add here :)

@unpervertedkid
Copy link

unpervertedkid commented Dec 5, 2023

@SeanChao or @tottoto I would love to pick this up but I would kindly need some pointers. See linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants