Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/109#discussion_r98336104
--- Diff: guacamole/src/main/java/org/apache/guacamole/rest/APIRequest.java
---
@@ -58,6 +68,18 @@ public APIRequest(HttpServletRequest request,
super(request);
+ // Grab the remote host info.
+ if (request.getRemoteHost() != null &&
!request.getRemoteHost().isEmpty())
--- End diff --
Is it necessary to sanity check `getRemoteHost()` and `getRemoteAddr()`
against `isEmpty()`, given that their return values are guaranteed by the
standard? Assuming that the empty string, if it ever does occur, is a
legitimate value, doesn't this boil down to:
if (request.getRemoteHost() != null)
this.remoteHost = request.getRemoteHost();
else
this.remoteHost = null;
and thus could simply be:
this.remoteAddr = request.getRemoteAddr();
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---