-
Notifications
You must be signed in to change notification settings - Fork 39
Added support to specify Custom Hop-By-Hop Headers #140
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
base: main
Are you sure you want to change the base?
Conversation
| */ | ||
| public static final boolean DEFAULT_SUPPORT_WEBSOCKET = true; | ||
|
|
||
| public static final List<String> DEFAULT_HOP_BY_HOP_HEADERS = new ArrayList<>(Arrays.asList( |
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 a Set would be better here
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.
Yes, updated this. Used Set instead of List
| * | ||
| * @param customHopHeaders the list of hop-by-hop headers to set | ||
| */ | ||
| public ProxyOptions setCustomHopHeaders(List<String> customHopHeaders){ |
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.
can you add an "adder" method : addCustomHopHeader
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.
Yes, added a new function addCustomHopHeader to allow adding hop header to existing set
| * @return a reference to this, so the API can be used fluently | ||
| */ | ||
| static ProxyRequest reverseProxy(HttpServerRequest proxiedRequest, List<String> customHopHeaders) { | ||
| proxiedRequest.pause(); |
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 would rather not add a new constructor and instead use a modifier on the 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.
Noted & made the changes for the same.
…stomHopHeader to allow adding headers to current hop headers set
Motivation:
To allow users to specify custom hop-by-hop headers.