clintropolis commented on code in PR #13489:
URL: https://github.com/apache/druid/pull/13489#discussion_r1065334119


##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerInitUtils.java:
##########
@@ -122,4 +127,25 @@ public static void 
addAllowHttpMethodsFilter(ServletContextHandler root, List<St
         null
     );
   }
+  
+  public static void maybeAddHSTSPatternRule(ServerConfig serverConfig, 
RewriteHandler rewriteHandler)
+  {
+    if (serverConfig.isEnableHSTS()) {
+      rewriteHandler.addRule(getHSTSHeaderPattern());
+    }
+  }
+
+  public static void maybeAddHSTSRewriteHandler(ServerConfig serverConfig, 
HandlerList handlerList)
+  {
+    if (serverConfig.isEnableHSTS()) {
+      RewriteHandler rewriteHandler = new RewriteHandler();
+      rewriteHandler.addRule(getHSTSHeaderPattern());
+      handlerList.addHandler(rewriteHandler);
+    }
+  }
+
+  private static HeaderPatternRule getHSTSHeaderPattern()
+  {
+    return new HeaderPatternRule("*", "Strict-Transport-Security", 
"max-age=63072000; includeSubDomains");

Review Comment:
   should this be configurable?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to