Skip to content

Apache Lucene open-source search software

SOLR-2020: fix FormBodyPart - The 2nd param is the contentType, not the name

Ryan McKinley728bf1a914df
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 fe328612d2d..5c5ed406142 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
@@ -290,7 +290,11 @@ public class HttpSolrServer extends SolrServer {
if (isMultipart) {
for (ContentStream content : streams) {
- parts.add(new FormBodyPart(content.getName(), new InputStreamBody(content.getStream(), content.getName())));
+ parts.add(new FormBodyPart(content.getName(),
+ new InputStreamBody(
+ content.getStream(),
+ content.getContentType(),
+ content.getName())));
}
}