Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request.getHttpURI().getScheme() is null on FORWARD dispatched request, causing NPE #11760

Closed
joakime opened this issue May 7, 2024 · 6 comments · Fixed by #11770
Closed
Labels
Bug For general bugs on Jetty side Sponsored This issue affects a user with a commercial support agreement

Comments

@joakime
Copy link
Contributor

joakime commented May 7, 2024

Jetty version(s)
12.0.8

Jetty Environment
ee8

Java version/vendor (use: java -version)
Any

OS type/version
Any

Description
When working with a RequestDispatcher forward request, the request.getHttpURI().getScheme() returns null.
It shouldn't return null in this use case.

@joakime joakime added Bug For general bugs on Jetty side Sponsored This issue affects a user with a commercial support agreement labels May 7, 2024
@janbartel
Copy link
Contributor

@joakime can you please clarify if this is a cross-context dispatch or a dispatch within the same context?

@jluehe
Copy link
Contributor

jluehe commented May 8, 2024

@janbartel, it's a cross-context dispatch ...

@janbartel
Copy link
Contributor

Raised #11770

@jluehe
Copy link
Contributor

jluehe commented May 9, 2024

Thank you, @janbartel, for the quick fix! I've noticed your PR covers ee9 and ee10, but we're (still) on ee8. Would it be possible to apply the same change to ee8 as well?

@janbartel
Copy link
Contributor

The ee8 code is automatically generated from the ee9 code, so the fix will be available in ee8 too.

@jluehe
Copy link
Contributor

jluehe commented May 9, 2024

Oh nice! I had forgotten about that! Thank you, @janbartel

janbartel added a commit that referenced this issue May 10, 2024
* Issue #11760 fix NPE getRequestURL() for cross context

---------

Co-authored-by: Joakim Erdfelt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side Sponsored This issue affects a user with a commercial support agreement
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants