Fortinet white logo
Fortinet white logo

Script Reference Guide

HTTP:header_remove2(header_name, countid)

HTTP:header_remove2(header_name, countid)

Header_get_values() returns a count ID for each item. This count ID can be used in both header_remove2() and header_replace2() to remove and replace a certain header of a given name referenced by the count ID.

Syntax

HTTP:header_remove2(header_name, countid);

Arguments

Name Description

Header_name

A string which specifies the header name.

Countid

A integer which specifies the header_name serial number

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

Example

when HTTP_RESPONSE {
cookies=HTTP:header_get_values("Set-Cookie")
for k, v in pairs(cookies) do
debug("include cookie %s cnt %d\n", k, v)
end
if HTTP:header_remove2("Set-Cookie", 1) then
debug("remove 1st cookie\n")
end
}

Supported Version

FortiADC version 4.8.x and later.

HTTP:header_remove2(header_name, countid)

HTTP:header_remove2(header_name, countid)

Header_get_values() returns a count ID for each item. This count ID can be used in both header_remove2() and header_replace2() to remove and replace a certain header of a given name referenced by the count ID.

Syntax

HTTP:header_remove2(header_name, countid);

Arguments

Name Description

Header_name

A string which specifies the header name.

Countid

A integer which specifies the header_name serial number

Events

Applicable in the following events:

  • HTTP_REQUEST

  • HTTP_RESPONSE

Example

when HTTP_RESPONSE {
cookies=HTTP:header_get_values("Set-Cookie")
for k, v in pairs(cookies) do
debug("include cookie %s cnt %d\n", k, v)
end
if HTTP:header_remove2("Set-Cookie", 1) then
debug("remove 1st cookie\n")
end
}

Supported Version

FortiADC version 4.8.x and later.