Calling rest endpoint with x-forwarded-host
and native
forward headers strategy set causes malformed URI
#34395
Labels
for: external-project
For an external project and not something we can fix
Hi,
My project is using
server.forward-headers-strategy: native
to apply somex-forward
headers. I just upgraded my project to Spring Boot 3.0.3 and am now seeing all my requests with anx-forwarded-host
header oflocalhost:3000
fail with this errorI have made a sample repo to show the problem. I tried making a test to show the failure, but the test seems to take a different path then when calling the server directly via postman. You will need to add some headers to postman(curl will also likely work) which are described in the readme.
This works as expected when either using 3.0.2, changing the headers strategy to
framework
, or just removing the forwarded host header. It does seem that the non problematic calls do not useReactorHttpHandlerAdapter
but rather useHttpWebHandlerAdapter
instead.It does seem weird to me that the port is also included in the
x-forwarded-host
but there doesn't seem to be a standard way of doing these headers, and that is how the frontend library I am using sets them that way.The text was updated successfully, but these errors were encountered: