spring-cloud / spring-cloud/spring-cloud-gateway
XForwardedHeadersFilter does not add X-Forwarded-For when remote address is an IPv6
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
This is a continuation of the Forwarded headers bug, but this time for XForwardedFilter
After adding property spring.cloud.gateway.forwarded.enabled=false to https://github.com/ZIRAKrezovic/gateway-reproducer, XForwardedFilter check for remote address fails when IPv6 is parsed as remote address
Last conditional will fail, and X-Forwarded-For will not be added to the 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 at XForwardedFilter and inspect the conditional that checks the remote address, using the gateway-reproducer configuration described in the issue to reproduce the IPv6 case. Completion means X-Forwarded-For is added when the remote address is IPv6, while the existing behavior for other remote addresses remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- api, backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100