174 Citrix NetScaler Policy Configuration and Reference Guide
text.TYPECAST_HTTP_
HEADER_T Overrides the behavior of certain methods that are used with
protocol-aware prefixes. This operator can be used only with
protocol-aware prefixes that qualify standard HTTP headers,
that is, prefixes of the format HTTP.REQ.<STANDARD_
HEADER> (for example, HTTP.REQ.COOKIE and
HTTP.REQ.SET_COOKIE).
Protocol-aware prefixes of the format
HTTP.REQ.<STANDARD_HEADER> are used with
several methods, such as COUNT and VALUE("string").
TYPECAST_HTTP_HEADER_T overrides the behavior of
these methods.
Following are two examples of how TYPECAST_HTTP_
HEADER_T overrides the behavior of methods associated
with protocol-aware prefixes for HTTP headers:
Example 1: HTTP.REQ.COOKIE.COUNT returns the total
number of name-value pairs present in Cookie headers.
HTTP.REQ.COOKIE.TYPECAST_HTTP_HEADER_
T.COUNT, however, overrides this behavior and retu rns the
number of instances of the COOKIE header.
Example 2: HTTP.REQ.COOKIE.VALUE(n) acc epts an
unsigned integer n (whose value can range from 0 to 14) as
an argument and selects the value of the first name-value
pair in the nth instance of the Cookie header, starting from
the last instance. Therefore,
HTTP.REQ.COOKIE.VALUE(0) selects the value of the
first name-value pair in the last instance of the Cookie
header, HTTP.REQ.COOKIE.V ALUE(1) selects the value of
the first name-value pair in the second to last instance of the
Cookie header, and so on. When used with TYPECAST_
HTTP_HEADER_T, however, the method returns the entire
value of the nth occurrence of the Cookie header, starting
from the last instance. Therefore, HTTP.REQ.COOKIE.
TYPECAST_HTTP_HEADER_T.VALUE(0) selects the
entire value of the last instance of the Cookie header,
HTTP.REQ.COOKIE.TYPECAST_HTTP_HEADER_T
.VALUE(1) selects the entire value of the second to last
instance of the Cookie header, and so on.
TYPECAST_HTTP_HEADER_T returns an error if used
with prefixes that are not protocol-aware. It returns an error
regardless of whether or not the header that is used in the
prefix is a standard HTTP header. For example, the
following expression returns an error even though the prefix
contains a standard header:
HTTP.REQ.HEADER("Cookie").TYPECAST_HTTP_
HEADER_T.CONTAINS("abc")
Typecasting Operations
Operation Description