Skip to content

Commit

Permalink
Merge pull request Netflix#115 from hammer2j2/1.x
Browse files Browse the repository at this point in the history
Getting feet wet, added origin host header for sites which require it ma...
  • Loading branch information
NiteshKant committed Aug 26, 2015
2 parents be63e1d + 3057f90 commit fd0a0f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fd0a0f6

Please sign in to comment.