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


##########
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:
   this is a standard header value. If there is a need for it, we can add a new 
config option later on. I would like to avoid adding another config param right 
now. If users ask for it, adding a new config option is easy. 



-- 
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