-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Enable forwarded for host header configuration #10138
Conversation
|
* Enable override the received request's host through a forwarded host header. | ||
*/ | ||
@ConfigItem(defaultValue = "false") | ||
public boolean enableForwardedForHostHeader; |
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.
This feels a bit long, maybe 'enableForwardedHost' ?
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.
done
if (hostHeader != null) { | ||
setHostAndPort(hostHeader.split(",")[0], port); | ||
if (proxyConfig.enableForwardedForHostHeader) { | ||
AsciiString forwardedHeader = AsciiString.cached(proxyConfig.forwardedHostHeader); |
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.
It would be better to do this in the recorder, and pass it into the parser, so it is only done once and not once per request.
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.
done
* Holds configuration related with proxy addressing forward. | ||
*/ | ||
@ConfigGroup | ||
public class ProxyConfig { |
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.
I think the existing proxy config should be moved to this class as well (proxyAddressForwarding and allowForwarded).
To do this mark the original ones deprecated, change them to Optional, and then add new ones here. If the old ones are set then log a warning about deprecation and use those values, otherwise use the new config.
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.
done
My mail app didn't inform me about this new PR, time to look for a new mail app :/ I like what I see here! Just one question: What about documentation? Some sentences in docs/src/main/asciidoc/vertx.adoc like in https://github.com/quarkusio/quarkus/pull/9809/files#diff-69f9c3e57ab7a8001e01e5d4683e057a would be helpful. |
Hi @stuartwdouglas, a short friendly reminder: Please check @ejba 's recent changes and update your review status. I'm really looking forward to that merge :) |
This is the first part of #9622 that enable users to configure the header to be used to override the HTTP request's host.