Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-6360: Remove bogus "Content-Charset" header in HttpSolrServer

Uwe Schindler498915a8246f
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e654eb6fcbc..d4118d2d62a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -340,6 +340,9 @@ Other Changes
* SOLR-6313: Improve SolrCloud cloud-dev scripts. (Mark Miller, Vamsee Yarlagadda)
+* SOLR-6360: Remove bogus "Content-Charset" header in HttpSolrServer. (Michael Ryan,
+ Uwe Schindler)
+
================== 4.9.0 ==================
Versions of Major Components
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
index 37f5cf9e8a1..d60db52405a 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrServer.java
@@ -322,7 +322,6 @@ public class HttpSolrServer extends SolrServer {
LinkedList<NameValuePair> postParams = new LinkedList<>();
if (streams == null || isMultipart) {
HttpPost post = new HttpPost(url + ClientUtils.toQueryString( queryParams, false ));
- post.setHeader("Content-Charset", "UTF-8");
if (!isMultipart) {
post.addHeader("Content-Type",
"application/x-www-form-urlencoded; charset=UTF-8");
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java
index 7b33b705fc3..285da43bf72 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest.java
@@ -231,7 +231,6 @@ public class BasicHttpSolrServerTest extends SolrJettyTestBase {
assertEquals("Solr[" + org.apache.solr.client.solrj.impl.HttpSolrServer.class.getName() + "] 1.0", DebugServlet.headers.get("User-Agent"));
assertEquals("keep-alive", DebugServlet.headers.get("Connection"));
assertEquals("application/x-www-form-urlencoded; charset=UTF-8", DebugServlet.headers.get("Content-Type"));
- assertEquals("UTF-8", DebugServlet.headers.get("Content-Charset"));
//XML/GET
server.setParser(new XMLResponseParser());
@@ -267,7 +266,6 @@ public class BasicHttpSolrServerTest extends SolrJettyTestBase {
assertEquals("Solr[" + org.apache.solr.client.solrj.impl.HttpSolrServer.class.getName() + "] 1.0", DebugServlet.headers.get("User-Agent"));
assertEquals("keep-alive", DebugServlet.headers.get("Connection"));
assertEquals("application/x-www-form-urlencoded; charset=UTF-8", DebugServlet.headers.get("Content-Type"));
- assertEquals("UTF-8", DebugServlet.headers.get("Content-Charset"));
server.shutdown();
}