Repository: guacamole-client Updated Branches: refs/heads/staging/1.0.0 b0da0d16b -> 34faa5d92
GUACAMOLE-540: Update comments; remove unnecessary setter methods. Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/c725da00 Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/c725da00 Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/c725da00 Branch: refs/heads/staging/1.0.0 Commit: c725da00a095216cd2a80cbecb4dd3a5c5e2406a Parents: cbd77b5 Author: Nick Couchman <vn...@apache.org> Authored: Tue May 15 13:50:28 2018 -0400 Committer: Nick Couchman <vn...@apache.org> Committed: Sat Jun 16 07:13:17 2018 -0400 ---------------------------------------------------------------------- .../apache/guacamole/net/auth/Credentials.java | 35 ++++---------------- 1 file changed, 6 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/c725da00/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java ---------------------------------------------------------------------- diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java index 741d858..16cf917 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/Credentials.java @@ -142,6 +142,9 @@ public class Credentials implements Serializable { /** * Sets the HttpServletRequest associated with this set of credentials. + * Also sets the remoteAddress and remoteHostname objects, checking the + * request for X-Forwarded-For or falling back to provided remote address. + * * @param request The HttpServletRequest to associated with this set of * credentials. */ @@ -153,14 +156,14 @@ public class Credentials implements Serializable { if (header != null) { Matcher matcher = X_FORWARDED_FOR.matcher(header); if (matcher.matches()) - setRemoteAddress(matcher.group(1)); + this.remoteAddress = matcher.group(1); } // Header not present, just use remote address else { - setRemoteAddress(request.getRemoteAddr()); + this.remoteAddress = request.getRemoteAddr(); } - setRemoteHostname(request.getRemoteHost()); + this.remoteHostname = request.getRemoteHost(); } @@ -195,18 +198,6 @@ public class Credentials implements Serializable { } /** - * Sets the address of the client end of the connection which provided - * these credentials. - * - * @param remoteAddress - * The address of the client end of the connection which provided these - * credentials, or null if the address is not known. - */ - public void setRemoteAddress(String remoteAddress) { - this.remoteAddress = remoteAddress; - } - - /** * Returns the hostname of the client end of the connection which provided * these credentials, if known. If the hostname of the client cannot be * determined, but the address is known, the address may be returned @@ -220,18 +211,4 @@ public class Credentials implements Serializable { return remoteHostname; } - /** - * Sets the hostname of the client end of the connection which provided - * these credentials, if known. If the hostname of the client cannot be - * determined, but the address is known, the address may be specified - * instead. - * - * @param remoteHostname - * The hostname or address of the client end of the connection which - * provided these credentials, or null if the hostname is not known. - */ - public void setRemoteHostname(String remoteHostname) { - this.remoteHostname = remoteHostname; - } - }