Skip to content

Commit

Permalink
Add parameter to ignore case sensitive headers
Browse files Browse the repository at this point in the history
Related Issue: wso2/api-manager#2219
  • Loading branch information
rosensilva committed Oct 18, 2023
1 parent 9d3d43d commit 4937798
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 4937798

Please sign in to comment.