nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pvill...@apache.org
Subject nifi git commit: NIFI-4714 - Use lowercase hostname for validation.
Date Thu, 21 Dec 2017 13:38:49 GMT
Repository: nifi
Updated Branches:
  refs/heads/master febb119fa -> e8f6ff440


NIFI-4714 - Use lowercase hostname for validation.

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #2355.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/e8f6ff44
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/e8f6ff44
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/e8f6ff44

Branch: refs/heads/master
Commit: e8f6ff440a6b7114f9374c227ef2fa896e707f26
Parents: febb119
Author: Koji Kawamura <ijokarumawak@apache.org>
Authored: Thu Dec 21 14:11:14 2017 +0900
Committer: Pierre Villard <pierre.villard.fr@gmail.com>
Committed: Thu Dec 21 14:38:36 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/nifi/web/server/HostHeaderHandler.java  | 4 ++--
 .../apache/nifi/web/server/HostHeaderSanitizationCustomizer.java | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/e8f6ff44/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderHandler.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderHandler.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderHandler.java
index 0b3a8be..61e825d 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderHandler.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderHandler.java
@@ -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);
         }

http://git-wip-us.apache.org/repos/asf/nifi/blob/e8f6ff44/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderSanitizationCustomizer.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderSanitizationCustomizer.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderSanitizationCustomizer.java
index 5a10610..3a7b22b 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderSanitizationCustomizer.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/HostHeaderSanitizationCustomizer.java
@@ -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);
         }


Mime
View raw message