Skip to content

Use container request and response for async dispatch - #37717

Closed
jimi-21 wants to merge 1 commit into
spring-projects:mainfrom
jimi-21:fix/async-forwarded-prefix
Closed

jimi-21 wants to merge 1 commit into
spring-projects:mainfrom
jimi-21:fix/async-forwarded-prefix

Conversation

@jimi-21

@jimi-21 jimi-21 commented Nov 18, 2026

Copy link
Copy Markdown

Summary

  • Start async processing with the original container request and response.
  • Avoid Jetty dispatching to a forwarded-prefix URI supplied by a request wrapper instead of the original handler path.

Verification

  • Added container request/response invocation coverage to StandardServletAsyncWebRequestTests.
  • The issue reproducer's Jetty matrix now passes all 8 cases, including StreamingResponseBody, Callable, and DeferredResult with X-Forwarded-Prefix.
  • All Spring scenarios in the full Jetty/Tomcat matrix pass. The remaining failure is the author's intentional Servlet-only demonstration of Jetty's native behavior.
  • ./gradlew :spring-web:check: 4,125 tests ran; 3 unrelated DirectByteBuffer failures were also reproduced on unmodified main with the same JDK.

Closes gh-37681

Start async processing with the original container request and response. Supplying wrappers whose request URI includes a forwarded prefix causes Jetty to dispatch to the prefixed path instead of the handler path.

Closes spring-projectsgh-37681

Signed-off-by: hejingming368-max <hejingming368@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Nov 18, 2026
@bclozel

bclozel commented Nov 18, 2026

Copy link
Copy Markdown
Member

Please read the state of the original issue before throwing an LLM at it.

@bclozel bclozel closed this Nov 18, 2026
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async requests fail on Jetty when ForwardedHeaderFilter applies X-Forwarded-Prefix

3 participants