Replace/Clear X-Forwarded-4 or insert if not existent
Hello,
We're using the following script to insert an XFF header.
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-For" [IP::client_addr]
}
How do I change it to SET (not insert) a single header ?
I mean if there is already an XXF, we want to clear it....before inserting our own.
Thank you
We're using the following script to insert an XFF header.
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-For" [IP::client_addr]
}
How do I change it to SET (not insert) a single header ?
I mean if there is already an XXF, we want to clear it....before inserting our own.
Thank you
0
Comments
You can do this when using: Sets the value of the named header. If the header is present, the command replaces the header; otherwise, the com- mand adds the header. You can omit the <value> argument if the header name does not collide with any other val- ues.
And make it:
Thank you....
If there is a chance there are multiple instances of the same header, the HTTP:header command will only overwrite one.
You need to use "HTTP:header remove" first to remove all instances of that header.
Before you add a new one or insert one.