mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-47: Merge support for GUAC_CLIENT_HOSTNAME and GUAC_CLIENT_ADDRESS parameter tokens.
This commit is contained in:
		| @@ -41,6 +41,16 @@ public class APIRequest extends HttpServletRequestWrapper { | ||||
|      */ | ||||
|     private final Map<String, String[]> parameters; | ||||
|  | ||||
|     /** | ||||
|      * The hostname of the client that initiated the request. | ||||
|      */ | ||||
|     private final String remoteHost; | ||||
|  | ||||
|     /** | ||||
|      * The ip address of the client that initiated the request. | ||||
|      */ | ||||
|     private final String remoteAddr; | ||||
|  | ||||
|     /** | ||||
|      * Wraps the given HttpServletRequest, using the given MultivaluedMap to | ||||
|      * provide all request parameters. All HttpServletRequest functions which | ||||
| @@ -58,6 +68,12 @@ public class APIRequest extends HttpServletRequestWrapper { | ||||
|  | ||||
|         super(request); | ||||
|  | ||||
|         // Grab the remote host info | ||||
|         this.remoteHost = request.getRemoteHost(); | ||||
|  | ||||
|         // Grab the remote ip info | ||||
|         this.remoteAddr = request.getRemoteAddr(); | ||||
|  | ||||
|         // Copy parameters from given MultivaluedMap  | ||||
|         this.parameters = new HashMap<String, String[]>(parameters.size()); | ||||
|         for (Map.Entry<String, List<String>> entry : parameters.entrySet()) { | ||||
| @@ -101,4 +117,14 @@ public class APIRequest extends HttpServletRequestWrapper { | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getRemoteHost() { | ||||
|         return this.remoteHost; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getRemoteAddr() { | ||||
|         return this.remoteAddr; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user