You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(body): avoid double gzip compression in response middleware (#124)
* fix: avoid double gzip compression in response middleware
- 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]>
* test: improve test readability and consistency
- 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]>
* refactor: refactor gzip encoding handling to use centralized constant
- 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]>
---------
Signed-off-by: appleboy <[email protected]>
0 commit comments