diff --git a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/HSTSFilter.java b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/HSTSFilter.java index eb4fecf2bc2..a881126da13 100644 --- a/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/HSTSFilter.java +++ b/nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/HSTSFilter.java @@ -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();