GZIP body decompression before decoding through logging side effect
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
While upgrading Feign in SC OpenFeign to versions: 11.1, 11.2 (btw., I can't see this tag in repo, but the artifact is present in mvn), I have stumbled upon an issue:
When GZIP is set as CONTENT-ENCODING, the response body is now being wrapped with GZIPInputStream. When logging is not enabled, a response this GZIPInputStream body is then passed to decoders for further handling.
However, when logging is enabled, the GZIP body is decompressed here (through calling read(byte[] buf, int off, int len) from java.util.zip.GZIPInputStream.java) and then this decompressed byte array is set as response body here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading core/src/main/java/feign/Client.java and core/src/main/java/feign/Logger.java at the linked response-body handling points. Trace the response with GZIP content encoding through logging and decoding, then find or add a regression test covering both logging states. Done means enabling logging no longer changes the body supplied to the decoder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100