PDavid commented on code in PR #2362:
URL: https://github.com/apache/zookeeper/pull/2362#discussion_r3086314995


##########
zookeeper-metrics-providers/zookeeper-prometheus-metrics/src/main/java/org/apache/zookeeper/metrics/prometheus/PrometheusMetricsProvider.java:
##########
@@ -171,23 +181,47 @@ public void start() throws 
MetricsProviderLifeCycleException {
             int acceptors = 1;
             int selectors = 1;
 
-            // Configure HTTP connector if enabled
-            if (this.httpPort != -1) {
-                ServerConnector httpConnector = new ServerConnector(server, 
acceptors, selectors);
-                httpConnector.setPort(this.httpPort);
-                httpConnector.setHost(this.host);
-                server.addConnector(httpConnector);
-            }
+            ServerConnector connector = null;
+
+            if (this.httpPort != -1 && this.httpsPort != -1 && this.httpPort 
== this.httpsPort) {
+                SecureRequestCustomizer customizer = new 
SecureRequestCustomizer();
+                customizer.setStsMaxAge(DEFAULT_STS_MAX_AGE);
+                customizer.setStsIncludeSubDomains(true);

Review Comment:
   This sets a directive of the Strict-Transport-Security HTTP response header.
   
   > `includeSubDomains Optional`
   If this directive is specified, the HSTS policy applies to all subdomains of 
the host's domain as well.
   
   
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security#directives
   
   Same as we have in JettyAdminServer here:
   
   
https://github.com/apache/zookeeper/blob/master/zookeeper-server/src/main/java/org/apache/zookeeper/server/admin/JettyAdminServer.java#L120



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

Reply via email to