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

Controller cannot be found if absolute URI is given in HTTP request [SPR-16243] #20790

Closed
spring-issuemaster opened this issue Nov 29, 2017 · 3 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Nov 29, 2017

Oleg Alexeyev opened SPR-16243 and commented

Stack: Spring WebFlux 5.0.1, 5.0.2, reactor-netty 0.7.2, reactor-core 3.1.2, netty 4.1.17, java 8u154.

Some of our customers use our server as an HTTP proxy, resulting in absolute URI being sent in requests, e.g.:

GET http://server/path HTTP/1.1

Such a request results in 404 response having a controller on @GetMapping("/path"), while usual requests with relative URI are properly handled:

GET /path HTTP/1.1

While this looks like a marginal case, https://tools.ietf.org/html/rfc7230#section-5.3.2 states

To allow for transition to the absolute-form for all requests in some
future version of HTTP, a server MUST accept the absolute-form in
requests, even though HTTP/1.1 clients will only send them in
requests to proxies.

So, this sounds more like a bug.


Affects: 5.0.2

Issue Links:

  • #20791 Trying to rewrite request URI in a WebFilter fails on missing client TLS certificate

Referenced from: commits 203370a

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 29, 2017

Oleg Alexeyev commented

Seems I found a possible cause while debugging: when absolute URI is used in the request, WebFilter sees URI like this: http://serverhttp://server/path - looks like a mere concatenation of Host header and URI from the request line.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Nov 29, 2017

Rossen Stoyanchev commented

The logic to create the URI from the Reactor Netty request is here. Can you confirm on that line what the value of request.uri() is? I suspect it's the absolute URL.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 2, 2017

Rossen Stoyanchev commented

This should be addressed now with 203370. If you could please give 5.0.3.BUILD-SNAPSHOT a try with your application, once the current build completes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.