Permalink
Browse files

fix proxyservlet response url to respect http scheme if a relative

Location header is returned.
  • Loading branch information...
reger24 committed Mar 2, 2017
1 parent 9d9f86d commit 81963a89feec1d1ed8b9642fb74727e6b532126b
@@ -184,7 +184,7 @@ public void service (ServletRequest req, ServletResponse res) throws ServletExce
if (location.startsWith("http")) {
location = request.getServletPath() + "?url=" + location;
} else {
location = request.getServletPath() + "?url=http://" + hostwithport + "/" + location;
location = request.getServletPath() + "?url=" + proxyurl.getProtocol() + "://" + hostwithport + "/" + location;
}
response.addHeader(HeaderFramework.LOCATION, location);
}
@@ -161,7 +161,7 @@ public void service (ServletRequest req, ServletResponse res) throws ServletExce
if (location.startsWith("http")) {
location = request.getServletPath() + "?url=" + location;
} else {
location = request.getServletPath() + "?url=http://" + hostwithport + "/" + location;
location = request.getServletPath() + "?url=" + proxyurl.getProtocol() + "://" + hostwithport + "/" + location;
}
response.addHeader(HeaderFramework.LOCATION, location);
}

0 comments on commit 81963a8

Please sign in to comment.