SOLR-2020: don't send a null mime-type

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1328539 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2012-04-20 23:44:30 +00:00
parent 728bf1a914
commit a583705403
1 changed files with 6 additions and 2 deletions

View File

@ -290,10 +290,14 @@ public class HttpSolrServer extends SolrServer {
if (isMultipart) {
for (ContentStream content : streams) {
parts.add(new FormBodyPart(content.getName(),
String contentType = content.getContentType();
if(contentType==null) {
contentType = "application/octet-stream"; // default
}
parts.add(new FormBodyPart(content.getName(),
new InputStreamBody(
content.getStream(),
content.getContentType(),
contentType,
content.getName())));
}
}