Skip to content

Commit

Permalink
delegate to the library httpclient parse the content type (#1664)
Browse files Browse the repository at this point in the history
Fixes gh-1663
  • Loading branch information
eloipoch authored and spencergibb committed Feb 2, 2017
1 parent a2e1836 commit c87f6ca
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,7 @@ private HttpResponse forward(HttpClient httpclient, String verb, String uri,
ContentType contentType = null;

if (request.getContentType() != null) {
String contentTypeString = request.getContentType();
Charset charset = null;
if (contentTypeString.contains(";charset=")) {
final String[] split = contentTypeString.split(";charset=");
contentTypeString = split[0];
charset = Charset.forName(split[1]);
}
contentType = ContentType.create(contentTypeString, charset);
contentType = ContentType.parse(request.getContentType());
}

InputStreamEntity entity = new InputStreamEntity(requestEntity, contentLength, contentType);
Expand Down

0 comments on commit c87f6ca

Please sign in to comment.