guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mjum...@apache.org
Subject [08/13] incubator-guacamole-client git commit: GUACAMOLE-47: Fix checking for empty strings; Set tokens to null if nothing found.
Date Sat, 28 Jan 2017 18:52:19 GMT
GUACAMOLE-47: Fix checking for empty strings; Set tokens to null if nothing found.


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/1b9f7c51
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/1b9f7c51
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/1b9f7c51

Branch: refs/heads/master
Commit: 1b9f7c51549e2e87a75e4f4a4b3c3ab145a58141
Parents: b785fc2
Author: Nick Couchman <nick.couchman@yahoo.com>
Authored: Wed Jan 25 12:40:12 2017 -0500
Committer: Nick Couchman <nick.couchman@yahoo.com>
Committed: Sat Jan 28 13:40:09 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/guacamole/rest/APIRequest.java  | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/1b9f7c51/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 c1c9612..5ee31e1 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
@@ -69,24 +69,24 @@ public class APIRequest extends HttpServletRequestWrapper {
         super(request);
 
         // Try a few methods to get client info.
-        if(request.getHeader("X-Guacamole-Client-Hostname") != null && request.getHeader("X-Guacamole-Client-Hostname")
!= "") {
+        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")
!= "") {
+        } else if(request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
{
             this.remoteHost = request.getHeader("X-Forwarded-For");
-        } else if(request.getRemoteHost() != null && request.getRemoteHost() != "")
{
+        } else if(request.getRemoteHost() != null && !request.getRemoteHost().isEmpty())
{
             this.remoteHost = request.getRemoteHost();
         } else {
-            this.remoteHost = "";
+            this.remoteHost = null;
         }
 
-        if(request.getHeader("X-Guacamole-Client-IP") != null && request.getHeader("X-Guacamole-Client-IP")
!= "") {
+        if(request.getHeader("X-Guacamole-Client-IP") != null && !request.getHeader("X-Guacamole-Client-IP").isEmpty())
{
             this.remoteAddr = request.getHeader("X-Guacamole-Client-IP");
-        } else if(request.getHeader("X-Forwarded-For") != null && request.getHeader("X-Forwarded-For")
!= "") {
+        } else if(request.getHeader("X-Forwarded-For") != null && !request.getHeader("X-Forwarded-For").isEmpty())
{
             this.remoteAddr = request.getHeader("X-Forwarded-For");
-        } else if(request.getRemoteHost() != null && request.getRemoteAddr() != "")
{
+        } else if(request.getRemoteHost() != null && !request.getRemoteAddr().isEmpty())
{
             this.remoteAddr = request.getRemoteAddr();
         } else {
-            this.remoteAddr = "";
+            this.remoteAddr = null;
         }
 
         // Copy parameters from given MultivaluedMap 


Mime
View raw message