Skip to content

Commit

Permalink
Merge pull request payara#6683 from kalinchan/FISH-8543
Browse files Browse the repository at this point in the history
FISH-8543 Check if HSTS Header is already present
  • Loading branch information
kalinchan authored and Pandrex247 committed May 8, 2024
1 parent f53cb0f commit 5a24fe2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public NextAction handleRead(FilterChainContext ctx) throws IOException {
Object message = ctx.getMessage();
if (message instanceof HttpContent && enabled) {
HttpContent content = (HttpContent) message;
content.getHttpHeader().addHeader(HSTS_HEADER, header);
if(!content.getHttpHeader().containsHeader(HSTS_HEADER)) {
content.getHttpHeader().addHeader(HSTS_HEADER, header);
}
}

return ctx.getInvokeAction();
Expand Down

0 comments on commit 5a24fe2

Please sign in to comment.