delegate to the library httpclient parse the content type (#1664)

Fixes gh-1663
This commit is contained in:
Eloi
2017-02-02 17:05:01 +01:00
committed by Spencer Gibb
parent a2e1836e24
commit c87f6ca983

View File

@@ -280,14 +280,7 @@ public class SimpleHostRoutingFilter extends ZuulFilter {
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);