Skip to content

Commit

Permalink
Merge pull request #2107 from rosensilva/duplicate-headers-fix
Browse files Browse the repository at this point in the history
Add parameter to ignore case sensitive headers
  • Loading branch information
rosensilva authored Jan 10, 2024
2 parents fbbe72a + 4937798 commit 23c3b04
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public int compare(String o1, String o2) {
});

for (Map.Entry<String, String> headerEntry : headerEntries) {
if (headerMap.containsKey(headerEntry.getKey())) {
if (headerMap.containsKey(headerEntry.getKey()) && !conf.isIgnoreCaseSensitiveHeaders()) {
excessHeaders.put(headerEntry.getKey(), headerMap.get(headerEntry.getKey()));
}
headerMap.put(headerEntry.getKey(), headerEntry.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,9 @@ public interface PassThroughConfigPNames {
* Defines whether viewing services are enabled or not
*/
public String BLOCK_SERVICE_LIST = "http.block_service_list";

/**
* Defines whether to ignore case-sensitive headers from excess headers map
*/
public String IGNORE_CASE_SENSITIVE_HEADERS = "ignore_case_sensitive_headers";
}
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,14 @@ public String getPassThroughDefaultServiceName() {
}
return passThroughDefaultServiceName;
}

/**
* Get the value of the property to ignore case-sensitive headers from excess headers
*
* @return Value of the property
*/
public boolean isIgnoreCaseSensitiveHeaders() {
return ConfigurationBuilderUtil.getBooleanProperty(PassThroughConfigPNames.IGNORE_CASE_SENSITIVE_HEADERS,
false, props);
}
}

0 comments on commit 23c3b04

Please sign in to comment.