OpenFeign / OpenFeign/feign

GZIP body decompression before decoding through logging side effect

Open
#1,399 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.