
44 Brocade Virtual ADX OpenScript API Guide
53-1003243-01
Methods
5
OS_HTTP_REQUEST::url_extension
Returns URL extension specified in the HTTP request header if it exists, otherwise it will return
NULL.
Context
HTTP request event. If called in the HTTP response context, undefined will be returned.
Usage
Can be used to perform load-balancing based on a url extension.
Input Parameters
None.
Return Values
The following table contains the return values.
Example
OS_HTTP_REQUEST::version
Returns request version specified in the HTTP request header if it exists, otherwise it will return
NULL.
Context
HTTP request event. If called in the HTTP response context, undefined will be returned.
TABLE 37 Return Values
Name Type Description
string Value of the URL extension. If
not present, undefined is
returned.
use OS_HTTP_REQUEST;
use OS_SLB;
sub HTTP_REQUEST{
$ext = OS_HTTP_REQUEST::url_extension;
if($ext eq "jpg")
{
OS_SLB::forward(1);
} else {
OS_SLB::forward(2);
}
}
Komentarze do niniejszej Instrukcji