Prioritize X-Forwarded-Host when choosing the service parameter

Use X-Forwarded-Host whenever it's available.
This commit is contained in:
Cliff Ingham 2018-12-14 16:28:55 -05:00 committed by GitHub
parent ba50664582
commit 2b1b7a142a
1 changed files with 1 additions and 5 deletions

View File

@ -237,11 +237,7 @@ public final class CommonUtils {
final String xHost = request.getHeader("X-Forwarded-Host");
final String comparisonHost;
if (xHost != null && host == "localhost") {
comparisonHost = xHost;
} else {
comparisonHost = host;
}
comparisonHost = (xHost != null) ? xHost : host;
if (comparisonHost == null) {
return serverName;