92 Citrix NetScaler Policy Configuration and Reference Guide
Encoding and Decoding Text by Applying the Base64 Encoding Algorithm
The following two operators encode and decode a text string by applying the
Base64 encoding algorithm:
Refining the Search in a Rewrite Action by Using the EXTEND Operator
The EXTEND operator is used in rewrite actions that specify patterns or pattern
sets and target the bodies of HTTP packets. When a pattern match is found, the
EXTEND operator extends the scope of the search by a predefined number of
bytes on both sides of the matching string. A regular expression can then be used
to perform a rewrite on matches in this extended region. Rewrite actions that are
configured with the EXTEND operator perform rewrites faster than rewrite
actions that evaluate entire HTTP bodies using only regular expressions.
The format of the EXTEND operator is EXTEND(m,n), where m and n are the
number of bytes by which the scope of the search is extended before and after the
matching pattern, respectively. When a match is found, the new search scope
comprises m bytes that immediately precede the matching string, the string itself,
and the n bytes that follow the string. A regular expression can then be used to
perform a rewrite on a portion of this new string.
The EXTEND operator can be used only if the rewrite action in which it is used
fulfills the following requirements:
The search is performed by using patterns or patterns sets (not regular
expressions)
The rewrite action evaluates only the bodies of HTTP packets.
Additionally, the EXTEND operator can be used only with the following types of
rewrite actions:
• replace_all
• insert_after_all
Operators for Encoding and Decoding a Text String by Using Base64 Encoding
Operator Description
text.B64ENCODE Encodes the text string (designated by text) by applying the
Base64 encoding algorithm.
text.B64DECODE Decodes the Base64-encoded string (designated by text) by
applying the Base64 decoding algorithm. The operation
raises an UNDEF if text is not in B64-encoded format.