Skip to content

Conversation

@Yash-294
Copy link

Motivation:

To allow users to specify custom hop-by-hop headers.

*/
public static final boolean DEFAULT_SUPPORT_WEBSOCKET = true;

public static final List<String> DEFAULT_HOP_BY_HOP_HEADERS = new ArrayList<>(Arrays.asList(
Copy link
Member

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

Copy link
Author

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){
Copy link
Member

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

Copy link
Author

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();
Copy link
Member

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

Copy link
Author

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants