iRules "Operation not supported" log errors
We want to insert a HTTP header with the following name "client-ip" in a HTTP Request which has the value of the Client Source IP address. But we also want to check if this header exist, and if it does, remove that header and insert a new one. Also if there are more than 1 client-ip headers, remove all those headers first.
We made the following iRule, and that seems to work:
when HTTP_REQUEST {
if { [HTTP::header exists "client-ip"] } {
foreach aHeader [HTTP::header client-ip] {
HTTP::header remove client-ip
}
HTTP::header insert client-ip [IP::client_addr]
} else {
HTTP::header insert client-ip [IP::client_addr]
}
}
But we see a lot of errors in the LTM log which looks like these:
Sep 27 08:37:08 err tmm9[19631]: 01220001:3: TCL error: /Common/request_insert_client-ip - Operation not supported (line 7) invoked from within "HTTP::header insert client-ip [IP::client_addr]"
Is the iRule causing this error, because "something" is wrong within the iRule content? If we look at the iRule statistics we see no errors in the execution of this iRule. We are running version 12.1.2-HF2
Any help would be appreciated.
Hille