ltm rule command URI compare
iRule(1) BIG-IP TMSH Manual iRule(1)
URI::compare
Compares two URI's for equality.
SYNOPSIS
URI::compare URI_STRING URI_STRING
DESCRIPTION
Compares two URI's as recommended by RFC2616 section 3.2.3.
3.2.3 URI Comparison
When comparing two URIs to decide if they match or not, a client
SHOULD use a case-sensitive octet-by-octet comparison of the entire
URIs, with these exceptions:
- A port that is empty or not given is equivalent to the default
port for that URI-reference;
- Comparisons of host names MUST be case-insensitive;
- Comparisons of scheme names MUST be case-insensitive;
- An empty abs_path is equivalent to an abs_path of "/".
Characters other than those in the "reserved" and "unsafe" sets (see
RFC 2396 ) are equivalent to their ""%" HEX HEX" encoding.
For example, the following three URIs are equivalent:
http://abc.com:80/~smith/home.html
http://ABC.com/%7Esmith/home.html
http://ABC.com:/%7esmith/home.html
Syntax
URI::compare
* Compare two URI's as recommended by RFC2616 section 3.2.3.
RETURN VALUE
Returns 1 if URIs match; 0 otherwise.
VALID DURING
ANY_EVENT
EXAMPLES
when HTTP_REQUEST {
set uri_to_check "/dir1/somepath"
if { [URI::compare [HTTP::uri] $uri_to_check] } {
log local0. "URI's are equal!"
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.0.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)