Forum Discussion
jaskel_106221
Nimbostratus
Aug 27, 2007Header insertion (newbie alert)
Hey there,
So, I'm really new to iRules, and I question about a HTTP::header insert
Basically, I am looking to 'replace' the value of a custom(?) header if it exists in the current...
hoolio
Cirrostratus
Aug 28, 2007Otherwise, you can use '[HTTP::header replace "Client-IP" [IP::client_addr]' (Click here), to replace the header with the new value if the header is set already or insert if it's not present already. If you wanted to be doubly sure that no header exists already, you could use this to remove all instances and then insert a new header:
when HTTP_REQUEST {
while {[HTTP::header exists "Client-IP"]} {
HTTP::header remove "Client-IP"
}
HTTP::header insert "Client-IP" [IP::client_addr]
}Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects