SOLR-6572 Trim whitespace for shards.tolerant and leaderUrl (#2311)

diff --git a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
index b06353f..b347565 100644
--- a/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
+++ b/solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
@@ -328,6 +328,7 @@
 
   private void setLeaderCoreUrl(String leaderCoreUrl) {
     if (leaderCoreUrl != null) {
+      leaderCoreUrl = leaderCoreUrl.trim();
       ClusterState clusterState =
           solrCore.getCoreContainer().getZkController() == null
               ? null
diff --git a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
index 8a6b875..875b17c 100644
--- a/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
+++ b/solr/solrj/src/java/org/apache/solr/common/params/ShardParams.java
@@ -123,7 +123,7 @@
     if (null == shardsTolerantValue || shardsTolerantValue.equals(REQUIRE_ZK_CONNECTED)) {
       return false;
     } else {
-      return StrUtils.parseBool(shardsTolerantValue); // throw an exception if non-boolean
+      return StrUtils.parseBool(shardsTolerantValue.trim()); // throw an exception if non-boolean
     }
   }
 }