fix proxyservlet response url to respect http scheme if a relative

Location header is returned.
pull/114/head
reger 8 years ago
parent 9d9f86dcdd
commit 81963a89fe

@ -184,7 +184,7 @@ public class UrlProxyServlet extends HttpServlet implements Servlet {
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 class YaCyProxyServlet extends HttpServlet implements Servlet {
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);
}

Loading…
Cancel
Save