thelabdude commented on a change in pull request #2010:
URL: https://github.com/apache/lucene-solr/pull/2010#discussion_r508868917



##########
File path: solr/core/src/java/org/apache/solr/core/ZkContainer.java
##########
@@ -263,4 +275,27 @@ public void close() {
   public ExecutorService getCoreZkRegisterExecutorService() {
     return coreZkRegister;
   }
+
+  private void setGlobalUrlScheme(final ZkController zkCtrl) {
+    // Set the global urlScheme from cluster prop or if that is not set, look 
at the urlScheme sys prop
+    final String urlScheme = 
zkCtrl.getZkStateReader().getClusterProperty(ZkStateReader.URL_SCHEME, null);
+    if (StringUtils.isNotEmpty(urlScheme)) {
+      // track the urlScheme in a global so we can use it during ZK read / 
write operations for cluster state objects
+      GlobalStateVars.singleton().setUrlScheme(urlScheme);
+    } else {
+      final String urlSchemeFromSysProp = System.getProperty(URL_SCHEME, HTTP);
+      if (HTTPS.equals(urlSchemeFromSysProp)) {
+        // it's OK to set the cluster prop to https b/c we're making the 
cluster more secure, not less
+        // wouldn't do this for http though
+        log.warn("Cluster property 'urlScheme' not set but system property is 
set to 'https'. Updating the cluster property to match.");

Review comment:
       I'll just remove this, not strictly necessary (was trying to save the 
user some work but could have side-effects)




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to