[ https://issues.apache.org/jira/browse/SOLR-10973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068051#comment-16068051 ]
ASF subversion and git services commented on SOLR-10973: -------------------------------------------------------- Commit 224f349857889d4ac8493cce0008eb51a2b7cb9b in lucene-solr's branch refs/heads/master from [~kwri...@metacarta.com] [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=224f349 ] SOLR-10973: Use the correct constructor for InputStreamBody. > SolrJ: ContentType is not parsed properly in HttpSolrClient > ----------------------------------------------------------- > > Key: SOLR-10973 > URL: https://issues.apache.org/jira/browse/SOLR-10973 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public) > Components: SolrJ > Affects Versions: 6.6 > Reporter: Karl Wright > Assignee: Karl Wright > > When multipart posting is used, the content type is passed to the constructor > for InputStreamBody as a simple string: > {code} > parts.add(new FormBodyPart(name, > new InputStreamBody( > content.getStream(), > contentType, > content.getName()))); > {code} > This is incorrect; HttpClient does not parse that contentType as anything > other than a mime type and thus blows up when you pass in something like > "text/plain; charset=utf-8". The correct code is: > {code} > parts.add(new FormBodyPart(name, > new InputStreamBody( > content.getStream(), > ContentType.parse(contentType), > content.getName()))); > {code} > This was discovered by a ManifoldCF user. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org