Logger logs unsent request headers even though Default in Client has restricted headers
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.8k
- Forks
- 1.9k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 41
Description
Since the default class Default in Client uses sun.net.www.protocol.http.HttpURLConnection, which has the set of restricted headers, even if I add a header using RequestTemplate#header(String, String), the actual HTTP request does not contain the header.
However feign.Logger logs not the actual request but the Request made by SynchronousMethodHandler#executeAndDecode(), which contains the restricted header I have added.
This inconsistency made me hard to discover the problem because there's no such documentation tells the logged request may not be the same as the actual HTTP request.
I hope to add some documentation that tells RequestTemplate you applied may not be the actual request or, if possible, make Logger logs the actual HTTP request.
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 with Default in Client and SynchronousMethodHandler#executeAndDecode(), then trace how RequestTemplate#header(String, String) reaches feign.Logger and the sun.net.www.protocol.http.HttpURLConnection client. Compare the logged Request with the headers sent by the actual HTTP request; done means either documenting this discrepancy clearly or making the logger reflect the sent request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100