Unverified Commit ee953bef by Eloi Committed by Spencer Gibb

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

Fixes gh-1663
parent 4ca231af
...@@ -278,14 +278,7 @@ public class SimpleHostRoutingFilter extends ZuulFilter { ...@@ -278,14 +278,7 @@ public class SimpleHostRoutingFilter extends ZuulFilter {
ContentType contentType = null; ContentType contentType = null;
if (request.getContentType() != null) { if (request.getContentType() != null) {
String contentTypeString = request.getContentType(); contentType = ContentType.parse(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);
} }
InputStreamEntity entity = new InputStreamEntity(requestEntity, contentLength, contentType); InputStreamEntity entity = new InputStreamEntity(requestEntity, contentLength, contentType);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment