moresandeep commented on a change in pull request #423:
URL: https://github.com/apache/knox/pull/423#discussion_r616106703
##########
File path:
gateway-spi/src/main/java/org/apache/knox/gateway/dispatch/ConfigurableDispatch.java
##########
@@ -41,13 +47,26 @@
public class ConfigurableDispatch extends DefaultDispatch {
private Set<String> requestExcludeHeaders =
super.getOutboundRequestExcludeHeaders();
private Set<String> responseExcludeHeaders =
super.getOutboundResponseExcludeHeaders();
+ private Map<String, String> requestAppendHeaders = new HashMap<>();
private Set<String> responseExcludeSetCookieHeaderDirectives =
super.getOutboundResponseExcludedSetCookieHeaderDirectives();
private Boolean removeUrlEncoding = false;
private Set<String> convertCommaDelimitedHeadersToSet(String headers) {
return headers == null ? Collections.emptySet(): new
HashSet<>(Arrays.asList(headers.split("\\s*,\\s*")));
}
+ private Map<String, String> convertJSONHeadersToMap(String headers) {
Review comment:
Sounds good, just to clarify what I mean following are few examples
```
<param>
<name>requestAppendHeaders</name>
<value>Transfer-Encoding:gzip, chunked; Keep-Alive: timeout=5,
max=1000</value>
</param>
```
Here `;` is used as separator BUT `;` is used in SET-COOKIE header e.g.
`Set-Cookie: <cookie-name>=<cookie-value>; Domain=<domain-value>; Secure;
HttpOnly`
The question here is should we be allowing to set headers like SET-COOKIE?
if yes how do we handle `;`
one way would be to use an escape `\;`
Also, I think your patch is for inbound requests only right? i.e. requests
coming in from client to Knox and knox setting headers on requests it
dispatches, not the other way around. If it is both ways then we might have
some issues.
See, now this is starting to look complicated :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]