[ 
https://issues.apache.org/jira/browse/SOLR-10973?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Karl Wright resolved SOLR-10973.
--------------------------------
       Resolution: Fixed
    Fix Version/s: 6.7
                   master (7.0)

> 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
>             Fix For: master (7.0), 6.7
>
>
> 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

Reply via email to