Fortinet white logo
Fortinet white logo

Script Reference Guide

url_compare(url1, url2)

url_compare(url1, url2)

Compares two URL strings, returns true if they are the same.

Syntax

url_compare(url1, url2);

Arguments

Name Description

url1, url2

Two urls which will be compared.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
url_list={};
url_list[1]="http://10.10.10.10:80/"
url_list[2]="http://10.10.10.10/"
url_list[3]="https://5.5.5.5:443/"
url_list[4]="https://5.5.5.5/"
url_list[5]="http://[2001::1]:80"
url_list[6]="http://[2001::1]"
url_list[7]="https://[2001:99:1]:443"
url_list[8]="https://[2001:99:1]"
for i = 1,8,2 do
if url_compare(url_list[i],url_list[i+1]) then
debug("URL_List %d %d Match !\n",i,i+1);
else
debug("URL_List %d %d NOT Match !\n",i,i+1);
end
end
}

Supported Version

FortiADC version 5.2.x and later.

url_compare(url1, url2)

url_compare(url1, url2)

Compares two URL strings, returns true if they are the same.

Syntax

url_compare(url1, url2);

Arguments

Name Description

url1, url2

Two urls which will be compared.

Events

Applicable in all events.

Example

when HTTP_REQUEST {
url_list={};
url_list[1]="http://10.10.10.10:80/"
url_list[2]="http://10.10.10.10/"
url_list[3]="https://5.5.5.5:443/"
url_list[4]="https://5.5.5.5/"
url_list[5]="http://[2001::1]:80"
url_list[6]="http://[2001::1]"
url_list[7]="https://[2001:99:1]:443"
url_list[8]="https://[2001:99:1]"
for i = 1,8,2 do
if url_compare(url_list[i],url_list[i+1]) then
debug("URL_List %d %d Match !\n",i,i+1);
else
debug("URL_List %d %d NOT Match !\n",i,i+1);
end
end
}

Supported Version

FortiADC version 5.2.x and later.