spring-cloud / spring-cloud/spring-cloud-gateway
ProxyExchange discards all incoming request headers when making a request with a body.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Affects: spring-cloud-gateway-webflux:3.1.1
Setup
Define an MVC RestController that accepts a ProxyExchange as an argument to a request handler method, and use the ProxyExchange object to issue a POST request (or any request that contains a body) to an upstream service, using a body created (or manipulated) in the request handler method.
Expected Behaviour
The ProxyExchange forwards the original request headers, minus filtered sensitive headers, and Content related headers in the upstream request.
Observed Behaviour
The ProxyExchange discards all original incoming headers, appending only the X-Forwarded-For and X-Forwarded-Proto headers. This behaviour is in contrast to the behaviour observed when using a ProxyExchange object to make requests to upstream services that do not contain bodies (GET, OPTIONS, etc).
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 the MVC RestController entry point that accepts ProxyExchange in spring-cloud-gateway-webflux:3.1.1, and reproduce a POST request whose body is created or manipulated by the handler. Trace how ProxyExchange builds the upstream request and compare it with the GET or OPTIONS path. Done means non-sensitive original headers and content-related headers are forwarded while X-Forwarded-For and X-Forwarded-Proto remain present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100