Apache Solr open-source search software
HttpShardHandlerFactory urlScheme -- use sys prop for default (#4008)
David Smiley6699580057af
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.javaindex 862283da609..737fd5385de 100644--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java@@ -224,7 +224,8 @@ public class HttpShardHandlerFactory extends ShardHandlerFactorypublic void init(PluginInfo info) {StringBuilder sb = new StringBuilder();NamedList<?> args = info.initArgs;- this.scheme = getParameter(args, INIT_URL_SCHEME, null, sb);+ // note: the sys prop is only used in testing+ this.scheme = getParameter(args, INIT_URL_SCHEME, System.getProperty(INIT_URL_SCHEME), sb);if (this.scheme != null && this.scheme.endsWith("://")) {this.scheme = this.scheme.replace("://", "");}diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.javaindex 76c251e0769..fc7faa12c3e 100644--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java@@ -17,8 +17,6 @@package org.apache.solr;import static java.util.Objects.requireNonNull;-import static org.apache.solr.common.cloud.ZkStateReader.HTTPS;-import static org.apache.solr.common.cloud.ZkStateReader.URL_SCHEME;import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;import static org.hamcrest.core.StringContains.containsString;@@ -291,7 +289,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {HttpJettySolrClient.setDefaultSSLConfig(sslConfig.buildClientSSLConfig());if (isSSLMode()) {// SolrCloud tests should usually clear this- System.setProperty(URL_SCHEME, HTTPS);+ System.setProperty("urlScheme", "https");}ExecutorUtil.resetThreadLocalProviders();@@ -325,7 +323,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {System.clearProperty("tests.shardhandler.randomSeed");System.clearProperty("solr.index.updatelog.enabled");System.clearProperty("useCompoundFile");- System.clearProperty(URL_SCHEME);+ System.clearProperty("urlScheme");System.clearProperty("solr.cloud.wait-for-updates-with-stale-state-pause");System.clearProperty("solr.zkclienttmeout");HttpClientUtil.resetHttpClientBuilder();