-
Notifications
You must be signed in to change notification settings - Fork 535
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
HTTP 1.0 request causes "Unhandled exception in router" #2629
Comments
RoutingContextImpl.java#83All requests without host header are rejected with code 400. Technically, for HTTP/1.0 this might not be completely correct. NPE in Router codeThis is actually not h2 related. It happens when trying to access RoutingContext#request().authority() from within a failure handler (regardless of allowForward settings).
The 2 issues are closely related. Documentation for HttpServerRequest#authority() informs explicitly about a nullable return value. HttpServerRequestWrapper#authority() should return null instead of throwing an NPE. Also, I see no strict reason to reject requests with null authority - it should always be handled by the user anyway. |
Would you like to contribute a fix for this? |
Yes sure. I have created a commit in my fork: b8b@a7edbe4 Is it good to target the 4.x branch with a pull request or should it rather target the master branch? |
Thank you !
We need to fix both the |
Fixed by #2640 |
Version
4.5.8
Context
When using a Router to handle http requests, sending an HTTP 1.0 request without host header triggers an exception.
Do you have a reproducer?
Additional observation
An h2 request with host header causes an NPE in the Router code.
The text was updated successfully, but these errors were encountered: