Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.6, 4.9
-
None
Description
The httpclient code in HttpSolrServer currently sets a "Content-Charset" header when making a POST request:
post.setHeader("Content-Charset", "UTF-8");
As far as I know this is not a real header and is not necessary. It seems this was a mistake in the original implementation of this class, when converting from httpclient v3 to httpclient v4. CommonsHttpSolrServer did this, which is what the line of code above seems to have been based on:
post.getParams().setContentCharset("UTF-8");
The actual way to set the charset in httpclient v4 is already being done correctly, with these lines:
parts.add(new FormBodyPart(p, new StringBody(v, StandardCharsets.UTF_8))); post.setEntity(new UrlEncodedFormEntity(postParams, StandardCharsets.UTF_8));
So basically, the Content-Charset line can just be removed.
(I think the explicit setting of the Content-Type header also might be unnecessary, but I haven't taken the time to investigate that.)
Attachments
Attachments
Issue Links
- relates to
-
SOLR-2020 HttpComponentsSolrServer
- Closed