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 5862114f55d..1202a531fd7 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 @@ -294,7 +294,7 @@ public class HttpSolrServer extends SolrServer { } if (parts.size() > 0) { - MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); + MultipartEntity entity = new MultipartEntity(HttpMultipartMode.STRICT); for(FormBodyPart p: parts) { entity.addPart(p); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index 6dd44878ebb..fdf7a5ee550 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -613,6 +613,17 @@ abstract public class SolrExampleTests extends SolrJettyTestBase assertNotNull("Couldn't upload xml files", result); rsp = server.query( new SolrQuery( "*:*") ); Assert.assertEquals( 5 , rsp.getResults().getNumFound() ); + + //params encoding, multipart + up = new ContentStreamUpdateRequest("/debug/dump"); + up.addFile(getFile("solrj/docs1.xml")); // 2 + up.addFile(getFile("solrj/docs2.xml")); // 3 + up.setParam("a", "\u1234"); + result = server.request(up); + System.out.println(result); + Assert.assertEquals("\u1234", + ((NamedList)((NamedList) result.get("responseHeader")).get("params")).get("a")); + }