-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HttpServletRequest#getRemoteAddr
is not adjusted if X-FORWARDED-FOR is present - regression from Jetty 11
#12767
Comments
We have 42 testcases that work with I added another one specifically for the combination of I suspect you don't have |
Thank you for the pointers; during the |
Here's a different way to test this (posted here in case others come across this issue) Setup the jetty.base for testing this with the jetty-home archive.
Run the server, with dump, and verify that the ForwardedRequestCustomizer is there.
On a different terminal, use the request dump endpoint to see the HttpServletRequest.getRemoteAddr value on ee10
Now, lets try with
Oops, the existing That filter is present in the WebApp due to a dynamic registration. Lines 149 to 162 in a171ad3
But we can override it with XML, there's a snippet that's commented out that we can just enable for that.
Restart the server and try again ...
Yup it works, even on the 12.0.16 release. |
Jetty version(s)
Jetty 12.0.16
Jetty Environment
EE10
Description
With Jetty 11, if
X-Forwarded-For
header is present,HttpServletRequest#getRemoteAddr
was getting adjusted by the following code inForwardedRequestCustomizer
:Jetty 12 does have a similar piece in
ForwardedRequestCustomizer
forConnectionMetaData
:But the computed result doesn't propagate to
HttpServletRequest#getRemoteAddr
correctly, leaving it with the original value.This looks like a regression from Jetty 11 behavior. It may be a desired breaking change in behavior to leave the original value and make uses reach for X-Forwarded-For directly if needed, but I can't find this stated anywhere.
The text was updated successfully, but these errors were encountered: