-
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
Allow multiple headers to be used for ForwardedRequestCustomizer #834
Comments
One wrinkle is if the header value is different. Eg: Standard: |
We should also implement rfc7239 |
How would the Servlet API's https://tools.ietf.org/html/rfc7239#section-6.3 Example from RFC: |
Currently planning to ignore _hidden and unknown headers |
Also handle legacy Https headers for #834
I have implemented #185 RFC7239. I also implemented legacy support for either X-Proxied-Https or X-Https-Terminated if configured. I have not implemented a fallback between legacy headers, as that can be implemented by adding multiple request customizers in the order you wish to check. |
I've reopened as I want to consider if multiple customizers is really the right solution. What if we have both sets of headers? |
Perhaps we establish a search order, and javadoc it. Proposal: RFC7239 -> Old/Standard Proxy Headers -> Custom Proxy Headers |
Closing again. I've added some tests, but I'm not going to add any more ordering than there already is. Currently it has RFC7239 -> OtherHeaders, where the other headers can be defacto standard or anything you want to set. It's too much to come up with something that will search 3 deep. You can always have 2 customizers and the second will overwrite the first, if your really need 2 or more legacy headers. |
@gregw, what's your take on using the new headers ? For example, And in all the places we reference |
@sbordet Oh I didn't know we were using X-Forwarded from So all server side usage should hang off the Client/proxy side is more difficult. If we are forwarding to ourselves, we should default to using the RFC7239 header. But we may forward to all sorts of different servers and I think that RFC7239 takeup appears moderately low. So I think we need to have configuration between at least RFC7239 and the defacto standard headers. Perhaps this needs to be fully configurable? I note that our proxy servlet does add the defactor standard headers, but the middleman servlet does not. We should probably develop some configurable common logic and use for both. I'll create a new issue to track this. |
Reopening to track the changes required to |
There are environments where the server can be hit by legacy proxies, and new proxies, with possibly different request headers for things like the remote-address and the scheme (https)
This is a feature request to allow ForwardedRequestCustomizer to utilize multiple headers (search order should be important) for each individual possible value.
The text was updated successfully, but these errors were encountered: