172 Citrix NetScaler Policy Configuration and Reference Guide
numeric
string.TYPECAST_IP_
ADDRESS_T
Treats a numeric string like an IP address.
For example, the following policy matches HTTP requests
that contains Cookie headers with a value of:
12.34.56.78\r\n.
set rewrite policy ip_check_policy -rule
'http.req.cookie.value("ip").typecast_ip_
address_t.eq(12.34.56.78)'
bind rewrite global ip_check_policy 200 -
type req_default
numeric
string.TYPECAST_
IPV6_ADDRESS_T
Treats a string as an IPv6 address in the following format:
0000:0000:CD00:0000:0000:00AB:0000:CDEF
text.TYPECAST_HTTP_
URL_T Treats the designated text as the URL in the first line of an
HTTP request header. The supported format is [protocol://
hostname]path?query, and the text mode is set to
URLENCODED by default.
For example, the following policy replaces a URL-encoded
part of a string in an HTTP header named Test.
add rewrite action replace_header_string
replace "http.req.header(\"Test\").typecast_
http_url_t.path.before_str(\"123\").after_
str(\"ABC\")" "\"string\""
add rewrite policy rewrite_test_header_
policy true replace_header_string
bind rewrite global rewrite_test_header_
policy 1 END -type res_override
Consider the following header:
Test: ABC%12123\r\n
This policy would replace the preceding header with the
value ABC%string123\r\n.
Typecasting Operations
Operation Description