diff --git a/zuul-simple-webapp/src/main/groovy/filters/pre/PreDecoration.groovy b/zuul-simple-webapp/src/main/groovy/filters/pre/PreDecoration.groovy index 0ef694bde3..e65d2c9340 100644 --- a/zuul-simple-webapp/src/main/groovy/filters/pre/PreDecoration.groovy +++ b/zuul-simple-webapp/src/main/groovy/filters/pre/PreDecoration.groovy @@ -44,6 +44,9 @@ class PreDecorationFilter extends ZuulFilter { // sets origin ctx.setRouteHost(new URL("http://apache.org/")); + // set origin host header + ctx.addZuulRequestHeader("Host","apache.org"); + // sets custom header to send to the origin ctx.addOriginResponseHeader("cache-control", "max-age=3600"); } diff --git a/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRequest.groovy b/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRequest.groovy index 958fdf472b..6f7e11e4cc 100644 --- a/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRequest.groovy +++ b/zuul-simple-webapp/src/main/groovy/filters/route/SimpleHostRequest.groovy @@ -306,6 +306,7 @@ class SimpleHostRoutingFilter extends ZuulFilter { boolean isValidHeader(String name) { if (name.toLowerCase().contains("content-length")) return false; + if (name.toLowerCase().equals("host")) return false; // set host according to origin vhost if (!RequestContext.currentContext.responseGZipped) { if (name.toLowerCase().contains("accept-encoding")) return false; }