mirror of https://github.com/apache/nifi.git
NIFI-4714 - Use lowercase hostname for validation.
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #2355.
This commit is contained in:
parent
febb119fac
commit
e8f6ff440a
|
@ -62,8 +62,8 @@ public class HostHeaderHandler extends ScopedHandler {
|
|||
// Different from customizer -- empty is ok here
|
||||
validHosts.add("");
|
||||
try {
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName());
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName() + ":" + serverPort);
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName().toLowerCase());
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName().toLowerCase() + ":" + serverPort);
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to determine local hostname.", e);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ public class HostHeaderSanitizationCustomizer implements HttpConfiguration.Custo
|
|||
validHosts.add("localhost");
|
||||
validHosts.add("localhost:" + serverPort);
|
||||
try {
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName());
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName() + ":" + serverPort);
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName().toLowerCase());
|
||||
validHosts.add(InetAddress.getLocalHost().getHostName().toLowerCase() + ":" + serverPort);
|
||||
} catch (final Exception e) {
|
||||
logger.warn("Failed to determine local hostname.", e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue