-
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
Issue #5247 ForwardedRequestCustomizer authority order rework #5251
Issue #5247 ForwardedRequestCustomizer authority order rework #5251
Conversation
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This is the search order for request.authority in an incoming request now.
|
+ Merge ProxyPass tests from CheckReverseProxyHeadersTest into ForwardedRequestCustomizerTest + Deleted CheckReverseProxyHeadersTest.java + Add more tests for ForcedHost configuration + Updated ForwardedRequestCustomizer to conform to expectations Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Current javadoc says (it looks better formatted, and linked, in javadoc) ...
|
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@gregw bump. review please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of niggles, but otherwise LGTM.
I don't think the CI failure is related?
* Lowest priority first. | ||
* </p> | ||
*/ | ||
public enum Priority |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than "Priority" I think "Source" is a better name for this. Will make more sense in logging to see something like "source=XFORWARDED_FOR". It also matches a lot of our webapp config stuff where we record the source, which is then used to determine the priority.
getAuthority().setHost(hostField.getHost(), Priority.FORWARDED); | ||
getAuthority().setPort(hostField.getPort(), Priority.FORWARDED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe:
getAuthority().setHost(hostField.getHost(), Priority.FORWARDED); | |
getAuthority().setPort(hostField.getPort(), Priority.FORWARDED); | |
getAuthority().setHostPort(hostField.getHost(), hostField.getPort(), Priority.FORWARDED); |
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This is an alternate approach for handling the search order for request.authority in ForwardedRequestCustomizer.
With javadoc.