mirror of https://github.com/apache/lucene.git
SOLR-2020: fix another bug with param encoding with multipart request
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1330803 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
021986f9f2
commit
fcfa443d3c
|
@ -294,7 +294,7 @@ public class HttpSolrServer extends SolrServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parts.size() > 0) {
|
if (parts.size() > 0) {
|
||||||
MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
|
MultipartEntity entity = new MultipartEntity(HttpMultipartMode.STRICT);
|
||||||
for(FormBodyPart p: parts) {
|
for(FormBodyPart p: parts) {
|
||||||
entity.addPart(p);
|
entity.addPart(p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -613,6 +613,17 @@ abstract public class SolrExampleTests extends SolrJettyTestBase
|
||||||
assertNotNull("Couldn't upload xml files", result);
|
assertNotNull("Couldn't upload xml files", result);
|
||||||
rsp = server.query( new SolrQuery( "*:*") );
|
rsp = server.query( new SolrQuery( "*:*") );
|
||||||
Assert.assertEquals( 5 , rsp.getResults().getNumFound() );
|
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"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue