diff --git a/zuul-netflix-webapp/src/main/groovy/filters/post/sendResponse.groovy b/zuul-netflix-webapp/src/main/groovy/filters/post/sendResponse.groovy index b74a075564..dbfc594215 100644 --- a/zuul-netflix-webapp/src/main/groovy/filters/post/sendResponse.groovy +++ b/zuul-netflix-webapp/src/main/groovy/filters/post/sendResponse.groovy @@ -29,6 +29,7 @@ import org.junit.runner.RunWith import org.mockito.Mockito import org.mockito.runners.MockitoJUnitRunner +import java.nio.charset.Charset import java.util.zip.GZIPInputStream import javax.servlet.http.HttpServletResponse @@ -77,7 +78,7 @@ class sendResponse extends ZuulFilter { try { if (RequestContext.currentContext.responseBody != null) { String body = RequestContext.currentContext.responseBody - writeResponse(new ByteArrayInputStream(body.bytes), outStream) + writeResponse(new ByteArrayInputStream(body.getBytes(Charset.forName("UTF-8"))), outStream) return; } diff --git a/zuul-simple-webapp/src/main/groovy/filters/post/SendResponse.groovy b/zuul-simple-webapp/src/main/groovy/filters/post/SendResponse.groovy index db469c9a52..aeb5ed4083 100644 --- a/zuul-simple-webapp/src/main/groovy/filters/post/SendResponse.groovy +++ b/zuul-simple-webapp/src/main/groovy/filters/post/SendResponse.groovy @@ -28,6 +28,7 @@ import org.junit.runner.RunWith import org.mockito.Mockito import org.mockito.runners.MockitoJUnitRunner +import java.nio.charset.Charset import java.util.zip.GZIPInputStream import javax.servlet.http.HttpServletResponse @@ -76,7 +77,7 @@ class SendResponseFilter extends ZuulFilter { try { if (RequestContext.currentContext.responseBody != null) { String body = RequestContext.currentContext.responseBody - writeResponse(new ByteArrayInputStream(body.bytes), outStream) + writeResponse(new ByteArrayInputStream(body.getBytes(Charset.forName("UTF-8"))), outStream) return; }