From 1a24fc6d25b15400b378bb636fb723576aa025b6 Mon Sep 17 00:00:00 2001 From: Vijitha Ekanayake Date: Mon, 15 Feb 2016 10:19:04 +0530 Subject: [PATCH] Fixing Zuul-Simple-Webapp to route POST request to RouteHost --- .../groovy/filters/route/SimpleHostRoutingFilter.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRoutingFilter.groovy b/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRoutingFilter.groovy index c5aff2b18a..9a34a051b6 100644 --- a/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRoutingFilter.groovy +++ b/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRoutingFilter.groovy @@ -90,7 +90,9 @@ class SimpleHostRoutingFilter extends ZuulFilter { }, 30000, 5000) } - public SimpleHostRoutingFilter() {} + public SimpleHostRoutingFilter() { + super(); + } private static final HttpClientConnectionManager newConnectionManager() { SSLContext sslContext = SSLContexts.createSystemDefault(); @@ -161,7 +163,7 @@ class SimpleHostRoutingFilter extends ZuulFilter { HttpServletRequest request = RequestContext.getCurrentContext().getRequest(); Header[] headers = buildZuulRequestHeaders(request) String verb = getVerb(request); - InputStream requestEntity = getRequestBody(request) + InputStream requestEntity = request.getInputStream(); CloseableHttpClient httpclient = CLIENT.get() String uri = request.getRequestURI() @@ -222,7 +224,7 @@ class SimpleHostRoutingFilter extends ZuulFilter { switch (verb) { case 'POST': httpRequest = new HttpPost(uri + getQueryString()) - InputStreamEntity entity = new InputStreamEntity(requestEntity, request.getContentLength()) + InputStreamEntity entity = new InputStreamEntity(requestEntity) httpRequest.setEntity(entity) break case 'PUT':