Skip to content

Conversation

@appleboy
Copy link
Member

  • Prevent double gzip compression when upstream response is already gzip-compressed or has a different Content-Encoding
  • Remove gzip headers and pass through unmodified when encountering existing compression
  • Add two tests verifying that middleware does not perform double compression with gzip-encoded responses and Prometheus metrics
  • Ensure decompression works correctly and responses are not gzip-encoded twice

fix #47

- Prevent double gzip compression when upstream response is already gzip-compressed or has a different Content-Encoding
- Remove gzip headers and pass through unmodified when encountering existing compression
- Add two tests verifying that middleware does not perform double compression with gzip-encoded responses and Prometheus metrics
- Ensure decompression works correctly and responses are not gzip-encoded twice

fix #47

Signed-off-by: appleboy <[email protected]>
- Split long assertion and error message lines for improved readability in tests
- Replace hardcoded "gzip" string with the gzipEncoding variable for consistency in tests
- Remove trailing blank line from handler.go

Signed-off-by: appleboy <[email protected]>
- Move the gzip encoding value to gzip.go and use the constant instead of a hardcoded string
- Remove the redundant gzipEncoding constant from handler_test.go

Signed-off-by: appleboy <[email protected]>
@appleboy appleboy merged commit 9e2912b into master Oct 26, 2025
7 checks passed
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.

Gzip will compress the compressed body again

2 participants