- Notifications
You must be signed in to change notification settings - Fork746
Add support for request decompression with gzip, br, and zstd#5248
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
github-actionsbot commentedDec 17, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
All contributors have signed the CLA ✍️ ✅ |
Uh oh!
There was an error while loading.Please reload this page.
GabrielBianconi commentedDec 17, 2025
Hi@RubyBit - thanks for the PR. Could you please accept the CLA above? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull request overview
This PR adds support for request decompression in the gateway, enabling clients to send compressed request bodies using gzip, br (Brotli), or zstd encodings. The implementation uses tower-http'sRequestDecompressionLayer middleware and includes comprehensive test coverage for all three compression formats.
- Added
RequestDecompressionLayermiddleware to the gateway router to transparently decompress incoming requests - Implemented test coverage for gzip, brotli, and zstd compression formats
- Enhanced test infrastructure with Windows-specific socket address handling
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| gateway/src/router.rs | AddedRequestDecompressionLayer to the middleware stack with support for gzip, br, and zstd encodings |
| gateway/tests/decompression.rs | New test file with compression helper functions and three comprehensive tests validating each supported encoding format |
| gateway/Cargo.toml | Added tower-http decompression features and test dependencies (flate2, zstd, brotli) |
| gateway/tests/common/mod.rs | Updated test helper to use localhost on Windows instead of 0.0.0.0 to avoid AddrNotAvailable errors |
| Cargo.lock | Updated lock file with new dependencies for compression support |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
RubyBit commentedDec 17, 2025
I have read the Contributor License Agreement (CLA) and hereby sign the CLA. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Uh oh!
There was an error while loading.Please reload this page.
Made some changes to support
gzip,brandzstdcontent encodings. The changes are rather simple, I just added theRequestDecompressionLayeras was discussed and then some tests which test if the gateway is able to decompress it successfully.Lmk for any changes!
Another change I did was a change on the gateway listening interface as on Windows it fails for 0.0.0.0 with AddrNotAvailable (I just added a conditional compilation for win).