I came across an issue where using “replace” did not replace the header with the new header.
Here is an example:
rule WL-Proxy-Client-IP-BAD {
when HTTP_REQUEST {
if { [HTTP::header exists “X-Forwarded-For”] } {
HTTP::header replace “X-Forwarded-For” “WL-Proxy-Client-IP”
}
}
}
My question is: since the iRule was accepted by BigIP, is the syntax correct and this does not work or is the syntax incorrect?
I found a work around:
rule WL-Proxy-Client-IP {
when HTTP_REQUEST {
if { [HTTP::header exists X-Forwarded-For] } {
HTTP::header remove X-Forwarded-For
HTTP::header insert WL-Proxy-Client-IP [IP::client_addr]
}
}
}
I would like to understand why the code above with replace did not work.
Thanks.
RL