Skip to content

Commit

Permalink
Merge pull request #415 from Cognifide/bugfix/headers-case-sensitive
Browse files Browse the repository at this point in the history
Fixed header matching to be case insensitive
  • Loading branch information
marcinczeczko authored Apr 20, 2018
2 parents 65eb4bc + 050477a commit c2a0f13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ List of changes that are finished but not yet released in any final version.
- [PR-384](https://github.com/Cognifide/knotx/pull/384) - Introduce Knot.x server backpressure mechanism
- [PR-399](https://github.com/Cognifide/knotx/pull/399) - Make knotx-core more concise and merge base Knot.x concepts into a single module
- [PR-395](https://github.com/Cognifide/knotx/pull/395) - Fix for [#394](https://github.com/Cognifide/knotx/issues/394) - implemented encoding request parameter names in `HttpRepositoryConnectorProxyImpl`
- [PR-415](https://github.com/Cognifide/knotx/pull/415) - bugfix: headers configurations (e.g. `allowedHeaders`) are now case insensitive

## Version 1.2.1
- [PR-385](https://github.com/Cognifide/knotx/pull/385) - Fix for [#107](https://github.com/Cognifide/knotx/pull/107) - Support for snippet tags other than `script`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ServiceSettings(JsonObject json) {
ServiceSettingsConverter.fromJson(json, this);
if (allowedRequestHeaders != null) {
allowedRequestHeadersPatterns = allowedRequestHeaders.stream()
.map(expr -> Pattern.compile(expr)).collect(Collectors.toList());
.map(expr -> Pattern.compile(expr, Pattern.CASE_INSENSITIVE)).collect(Collectors.toList());
}
}

Expand Down Expand Up @@ -149,7 +149,7 @@ public Set<String> getAllowedRequestHeaders() {
public ServiceSettings setAllowedRequestHeaders(Set<String> allowedRequestHeaders) {
this.allowedRequestHeaders = allowedRequestHeaders;
allowedRequestHeadersPatterns = allowedRequestHeaders.stream()
.map(expr -> Pattern.compile(expr)).collect(Collectors.toList());
.map(expr -> Pattern.compile(expr, Pattern.CASE_INSENSITIVE)).collect(Collectors.toList());
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public HttpRepositoryOptions(JsonObject json) {
HttpRepositoryOptionsConverter.fromJson(json, this);
if (allowedRequestHeaders != null) {
allowedRequestHeaderPatterns = allowedRequestHeaders.stream()
.map(expr -> Pattern.compile(expr)).collect(Collectors.toList());
.map(expr -> Pattern.compile(expr, Pattern.CASE_INSENSITIVE)).collect(Collectors.toList());
}
}

Expand Down

0 comments on commit c2a0f13

Please sign in to comment.