GUACAMOLE-47: When using XFF header, just set hostname component to null.

Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/f08a66bb
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/f08a66bb
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/f08a66bb

Branch: refs/heads/master
Commit: f08a66bb7f49b064edce30f617fb1543acb19e6a
Parents: 44a197c
Author: Nick Couchman <[email protected]>
Authored: Fri Jan 27 12:41:25 2017 -0500
Committer: Nick Couchman <[email protected]>
Committed: Sat Jan 28 13:40:09 2017 -0500

----------------------------------------------------------------------
 guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/f08a66bb/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java 
b/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
index 0101d62..29c9402 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
@@ -72,7 +72,7 @@ public class APIRequest extends HttpServletRequestWrapper {
         if (request.getHeader("X-Guacamole-Client-Hostname") != null && 
!request.getHeader("X-Guacamole-Client-Hostname").isEmpty())
             this.remoteHost = request.getHeader("X-Guacamole-Client-Hostname");
         else if (request.getHeader("X-Forwarded-For") != null && 
!request.getHeader("X-Forwarded-For").isEmpty())
-            this.remoteHost = request.getHeader("X-Forwarded-For");
+            this.remoteHost = null;
         else if (request.getRemoteHost() != null && 
!request.getRemoteHost().isEmpty())
             this.remoteHost = request.getRemoteHost();
         else

Reply via email to