Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed header matching to be case insensitive #415

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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