filter more explicitly for "localhost" in RedirectServlet

Change-Id: Ie8cf5857b52987e7d664aa65b387909f4ae4a932
This commit is contained in:
Axel Uhl committed 2016-01-07 10:10:30 +01:00
1 parent e2cfbf539d
commit 23f8487cf9
1 file changed
+3 -3
@@ -97,12 +97,12 @@ public class RedirectServlet extends HttpServlet {
} catch (MalformedURLException e) {
e.printStackTrace();
}
if (host.contains("local")){
if (host.startsWith("localhost")) {
host = "127.0.0.1";
}
String link = "http://" + host + ":" + port + baseLink;
int i = 1;
for(Entry<String, String> entry: parameters.entrySet()) {
for (Entry<String, String> entry : parameters.entrySet()) {
link += i == 1 ? "?" : "&";
link += entry.getKey() + "=" + entry.getValue();
i++;
@@ -115,7 +115,7 @@ public class RedirectServlet extends HttpServlet {
link += i == 1 ? "?" : "&";
link += "locale=" + localeParam;
}
logger.info("Redirecting from " + req.getRequestURL().toString() +" to: " + link);
logger.info("Redirecting from " + req.getRequestURL().toString() + " to: " + link);
return link;
}
}