Apache Solr open-source search software
SOLR-17864: solr.http.disableCookies --> solr.http.cookies.enabled (#3833)
Eric Pugh56ccbc37942d
diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmdindex 4adaa748a05..c90a9fa1c32 100755--- a/solr/bin/solr.in.cmd+++ b/solr/bin/solr.in.cmd@@ -250,3 +250,7 @@ REM set SOLR_MODULES=extraction,ltrREM Configure the default replica placement plugin to use if one is not configured in cluster propertiesREM See https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html for detailsREM set SOLR_PLACEMENTPLUGIN_DEFAULT=simple++REM Solr internally doesn't use cookies. If you don't need any of those, and you don't+REM need them for an external system (such as a load balancer), you can disable the use of a CookieStore with:+REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.solrj.http.cookies.enabled=falsediff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.shindex 8fae75a820e..4752790d44f 100644--- a/solr/bin/solr.in.sh+++ b/solr/bin/solr.in.sh@@ -250,12 +250,12 @@# This variable provides you with the option to disable the Admin UI. If you uncomment the variable below and# change the value to false. The option is configured as a system property as defined in SOLR_START_OPTS in the start# scripts.-# SOLR_UI_ENABLED=true+#SOLR_UI_ENABLED=true# This variable provides you with the option to disable the new experimental Admin UI. If you uncomment the variable# below and change the value to false, Jetty will not load the new-ui module which update the CSP directive for the# new UI endpoints. This property is ignored if SOLR_UI_ENABLED is false.-# SOLR_UI_EXPERIMENTAL_ENABLED=false+#SOLR_UI_EXPERIMENTAL_ENABLED=false# Solr is by default allowed to read and write data from/to SOLR_HOME and a few other well defined locations# Sometimes it may be necessary to place a core or a backup on a different location or a different disk@@ -278,10 +278,10 @@# Some previous versions of Solr use an outdated log4j dependency. If you are unable to use at least log4j version 2.15.0# then enable the following setting to address CVE-2021-44228-# SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"+#SOLR_OPTS="$SOLR_OPTS -Dlog4j2.formatMsgNoLookups=true"# The bundled plugins in the "modules" folder can easily be enabled as a comma-separated list in SOLR_MODULES variable-# SOLR_MODULES=extraction,ltr+#SOLR_MODULES=extraction,ltr# Configure the default replica placement plugin to use if one is not configured in cluster properties# See https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html for details@@ -289,4 +289,4 @@# Solr internally doesn't use cookies. If you don't need any of those, and you don't# need them for an external system (such as a load balancer), you can disable the use of a CookieStore with:-# SOLR_OPTS="$SOLR_OPTS -Dsolr.http.disableCookies=true"+#SOLR_OPTS="$SOLR_OPTS -Dsolr.solrj.http.cookies.enabled=false"diff --git a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adocindex a635789006c..a12d182b54f 100644--- a/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc+++ b/solr/solr-ref-guide/modules/configuration-guide/pages/solr-properties.adoc@@ -108,6 +108,8 @@ NOTE: Properties marked with "!" indicate inverted meaning between pre Solr 10 a|solr.solrj.cloud.max.stale.retries|cloudSolrClientMaxStaleRetries|5|Sets the maximum number of retries for stale connection attempts in SolrJ cloud client.+|solr.solrj.http.cookies.enabled|!solr.http.disableCookies| false |If Http2SolrClient should support cookies.+|solr.streamingexpressions.facet.tiered.enabled|solr.facet.stream.tiered|true|Controls whether tiered faceting is enabled for streaming expressions.|solr.streamingexpressions.macros.enabled|StreamingExpressionMacros|false|Controls whether to expand URL parameters inside of the `expr` parameter.diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.javaindex dab3e979517..a7b777cbc54 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java@@ -1050,7 +1050,7 @@ public class Http2SolrClient extends HttpSolrClientBase {if (cookieStore == null) {return cookieStore;}- if (Boolean.getBoolean("solr.http.disableCookies")) {+ if (!EnvUtils.getPropertyAsBool("solr.solrj.http.cookies.enabled", false)) {return new HttpCookieStore.Empty();}/*diff --git a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.propertiesindex f5bb1b3ab26..eabb2459df1 100644--- a/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties+++ b/solr/solrj/src/resources/DeprecatedSystemPropertyMappings.properties@@ -32,6 +32,8 @@ solr.host.bind=solr.jetty.hostsolr.host.advertise=host+solr.solrj.http.cookies.enabled=!solr.http.disable.cookies+solr.index.replication.fingerprint.enabled=!solr.disableFingerprintsolr.index.updatelog.enabled=enable.update.logdiff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.javaindex 8068705858a..da99074d3a8 100644--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java@@ -278,7 +278,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {System.setProperty("solr.clustering.enabled", "false");System.setProperty("solr.cloud.wait-for-updates-with-stale-state-pause", "500");System.setProperty("solr.filterCache.async", String.valueOf(random().nextBoolean()));- System.setProperty("solr.http.disableCookies", Boolean.toString(rarely()));+ System.setProperty("solr.solrj.http.cookies.enabled", Boolean.toString(usually()));System.setProperty("solr.metrics.jvm.enabled", "false");System.setProperty("solr.metrics.otlpExporterInterval", "1000");