header.filter
Available inall subroutines.
Removes all headers listed as parameters from the provided request, response,
or cached object variable, except for protected headers. This function call is
equivalent to using the unset
statement or the header.unset
function for
every header listed as a parameter. Header names are case insensitive.
Note that unlike
querystring.filter(),
header names are passed as individual arguments rather than a single string
with header names separated by an equivalent to querystring.filtersep
.
The where argument is one of the literal identifiers req
, resp
, obj
,
bereq
, or beresp
, corresponding to the predefined
variable of the same
name. The predefined variable associated with the where argument must be
writable within the VCL subroutine where header.filter
is called.
The headers arguments is a list of zero or more names of headers that will be removed from the provided where variable. Header names are ignored when they are not present on the provided where variable.
Some headers are protected. These headers cannot be modified, and are
unaffected by header.filter
.
See the Header reference
for which headers are protected.
Calling header.filter
with the empty string, a not-set value, or a string
that would be invalid as a header name, is not permitted by the compiler.
Example
The following example will remove the "Server", "X-Powered-By", and "Content-MD5" headers from the client response object.
header.filter(resp, "Server", "X-Powered-By", "Content-MD5");