Fix HSTS for middle manager (#13975)

Fix HSTS for middle manager
This commit is contained in:
Rishabh Singh 2023-03-25 14:01:09 +05:30 committed by GitHub
parent 549018d076
commit 598eaad7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 12 deletions

View File

@ -33,7 +33,6 @@ import org.apache.druid.server.security.AuthConfig;
import org.apache.druid.server.security.AuthenticationUtils;
import org.apache.druid.server.security.Authenticator;
import org.apache.druid.server.security.AuthenticatorMapper;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
@ -97,18 +96,18 @@ class MiddleManagerJettyServerInitializer implements JettyServerInitializer
root.addFilter(GuiceFilter.class, "/*", null);
final HandlerList handlerList = new HandlerList();
handlerList.setHandlers(
new Handler[]{
JettyServerInitUtils.getJettyRequestLogHandler(),
JettyServerInitUtils.wrapWithDefaultGzipHandler(
root,
serverConfig.getInflateBufferSize(),
serverConfig.getCompressionLevel()
),
new DefaultHandler()
}
);
JettyServerInitUtils.maybeAddHSTSRewriteHandler(serverConfig, handlerList);
handlerList.addHandler(JettyServerInitUtils.getJettyRequestLogHandler());
handlerList.addHandler(JettyServerInitUtils.wrapWithDefaultGzipHandler(
root,
serverConfig.getInflateBufferSize(),
serverConfig.getCompressionLevel()
));
handlerList.addHandler(new DefaultHandler());
server.setHandler(handlerList);
}
}