X-Forwarded-Prefix can no longer be enabled with the NATIVE strategy on Reactor Netty
Maintainers usually reply within 2 days
@bclozel is already working on this.
Since Oct 22, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- java, spring-boot
Research direction
Read NettyReactiveWebServerFactory and the change referenced as 66a093dbfa in #51031; trace how forwarded-header settings reach HttpServer.forwarded(...). Add the proposed server.netty.forwarded-headers.use-forwarded-prefix property with a default of false, then verify that native strategy honors X-Forwarded-Prefix when enabled and leaves it disabled by default.
Written by the indexing model from the issue text.
Description
Spring Boot: 4.2.0-M2
With server.forward-headers-strategy=native, a WebFlux application on Reactor Netty ignores X-Forwarded-Prefix in 4.2.0-M2, and theres no configuration property to enable it.
NettyReactiveWebServerFactory now calls HttpServer.forwarded(useStandardHeader, useForwardedPrefix) with useForwardedPrefix hard-coded to false (66a093dbfa, #51031).
With X-Forwarded-Prefix: /api and no other configuration, ServerHttpRequest.getPath().contextPath() is:
| Strategy | 4.1.1 | 4.2.0-M2 |
|---|---|---|
native |
/api |
(empty) |
framework |
/api |
(empty), can be enabled with spring.webflux.forwarded-headers.use-forwarded-prefix=true |
Not honoring the prefix by default matches spring-projects/spring-framework#37072, which suggests enabling it with "a separate property". However, that property only exists for the framework strategy. With native, the only options are switching strategies or writing a NettyServerCustomizer. The change also isnt mentioned in the 4.2.0-M1 release notes, so applications behind a proxy that sends X-Forwarded-Prefix will silently generate links and redirects without the prefix after upgrading.
Would you consider adding server.netty.forwarded-headers.use-forwarded-prefix (defaulting to false, like the Framework one) and passing it to HttpServer.forwarded(...)? Id be happy to submit a PR.
- Dominant language
- Java
- Stars
- 81.8k
- Forks
- 44.7k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 60
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from spring-projects/spring-boot
-
Maven process-test-aot only copies META-INF/native-image of the generated resources so the Logback configuration is lost in native testsPossibly taken @ZedingZhang claimed this 4 days ago. Openstatus: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
spring-projects/spring-boot#52301 · 3 comments ·
Maintainers usually reply within 2 days
-
status: waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 75/100
spring-projects/spring-boot#52296 ·
Maintainers usually reply within 2 days
-
status: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
spring-projects/spring-boot#52295 ·
Maintainers usually reply within 2 days
-
Prevent upgrade to Commons Codec 1.23.0Possibly taken @snicoll claimed this 5 days ago. Openstatus: team-only type: task
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
spring-projects/spring-boot#52143 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
Add a How-To to explain how to configure logging of AOT processingMay be free again @dana-stc claimed this 17 days ago, and no pull request is open. Openstatus: team-only type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spring-projects/spring-boot#52092 · 1 comment ·
Maintainers usually reply within 2 days
All issues in spring-projects/spring-boot
Similar issues
-
agent:working follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sanne/incus-spawn#1683 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
checkstyle/checkstyle#22210 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
521xueweihan/HelloGitHub#4105 ·
-
devops good first issue security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
asciidoctor/asciidoctorj#1339 ·