mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-784: Merge changes which tolerate the presence of a port number within X-Forwarded-For headers.
This commit is contained in:
@@ -106,11 +106,16 @@ public class AuthenticationService {
|
|||||||
*/
|
*/
|
||||||
private static final String IP_ADDRESS_REGEX = "(" + IPV4_ADDRESS_REGEX + "|" + IPV6_ADDRESS_REGEX + ")";
|
private static final String IP_ADDRESS_REGEX = "(" + IPV4_ADDRESS_REGEX + "|" + IPV6_ADDRESS_REGEX + ")";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regular expression which matches any Port Number.
|
||||||
|
*/
|
||||||
|
private static final String PORT_NUMBER_REGEX = "(:[0-9]{1,5})?";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pattern which matches valid values of the de-facto standard
|
* Pattern which matches valid values of the de-facto standard
|
||||||
* "X-Forwarded-For" header.
|
* "X-Forwarded-For" header.
|
||||||
*/
|
*/
|
||||||
private static final Pattern X_FORWARDED_FOR = Pattern.compile("^" + IP_ADDRESS_REGEX + "(, " + IP_ADDRESS_REGEX + ")*$");
|
private static final Pattern X_FORWARDED_FOR = Pattern.compile("^" + IP_ADDRESS_REGEX + PORT_NUMBER_REGEX + "(, " + IP_ADDRESS_REGEX + PORT_NUMBER_REGEX + ")*$");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a formatted string containing an IP address, or list of IP
|
* Returns a formatted string containing an IP address, or list of IP
|
||||||
|
Reference in New Issue
Block a user