Skip to content

fix: properly handle gzip-encoded responses#182

Closed
tstirrat15 wants to merge 3 commits intomainfrom
tstirrat/properly-handle-gzipped-responses
Closed

fix: properly handle gzip-encoded responses#182
tstirrat15 wants to merge 3 commits intomainfrom
tstirrat/properly-handle-gzipped-responses

Conversation

@tstirrat15
Copy link
Copy Markdown
Contributor

@tstirrat15 tstirrat15 commented Mar 3, 2026

Description

We've been seeing an issue with a system using this proxy and one of the characteristics is that the response is large - 200kb or so. @ivanauth pointed out that the k8s API will automatically gzip requests above 128kb, and we verified that we weren't handling that properly.

Developed with AI tooling help.

Changes

  • Add a failing e2e test
  • Fix that test

Testing

Revie.

@github-actions github-actions Bot added area/tooling Affects the dev or user toolchain area/core labels Mar 3, 2026
@tstirrat15 tstirrat15 force-pushed the tstirrat/properly-handle-gzipped-responses branch from 6d49d39 to a073073 Compare March 3, 2026 18:56
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 3, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.57%. Comparing base (067637c) to head (a20a397).

Files with missing lines Patch % Lines
pkg/authz/responsefilterer.go 20.00% 7 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (067637c) and HEAD (a20a397). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (067637c) HEAD (a20a397)
2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
- Coverage   69.30%   62.57%   -6.74%     
==========================================
  Files          27       25       -2     
  Lines        2864     2843      -21     
==========================================
- Hits         1985     1779     -206     
- Misses        623      773     +150     
- Partials      256      291      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tstirrat15 tstirrat15 force-pushed the tstirrat/properly-handle-gzipped-responses branch 2 times, most recently from b74670c to b78b286 Compare March 3, 2026 19:22
ecordell
ecordell previously approved these changes Mar 3, 2026
@tstirrat15 tstirrat15 force-pushed the tstirrat/properly-handle-gzipped-responses branch 2 times, most recently from 81d1745 to 3b2c2b8 Compare March 3, 2026 19:33
@tstirrat15 tstirrat15 force-pushed the tstirrat/properly-handle-gzipped-responses branch from 3b2c2b8 to c53a8e1 Compare March 3, 2026 19:35
vroldanbet and others added 2 commits March 4, 2026 12:47
FilterResp detects `Content-Encoding: gzip` and decompresses the body into plain bytes.
But it never removed the `Content-Encoding: gzip` header before passing the response back
to the client
…-responses-2

delete gzip header once decompressed
@tstirrat15
Copy link
Copy Markdown
Contributor Author

Closing in favor of #184.

@tstirrat15 tstirrat15 closed this Mar 4, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/core area/tooling Affects the dev or user toolchain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants