Forum Discussion
Nov 21, 2014
BIG-IP : irule : add request header ( replace if exists )
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
I need to add/replace a specific request header. Here's my iRule :
when HTTP_REQUEST {
if { [HTTP::header exists "original-uri"] } {
HTTP::header replace original-uri [HTTP::uri]
} else {
HTTP::header insert original-uri [HTTP::uri]
}
}
Is there a way to perform the insert/replace in a single line ?
- nitassEmployee
Is there a way to perform the insert/replace in a single line ?
can't you just remove (HTTP::header remove) and then insert (HTTP::header insert)?
- for case where header is not present : would [HTTP::header remove] throw an error ?
- nitassEmployeeno
- so why does [HTTP::header replace] command exist ?
- nitass_89166Noctilucent
Is there a way to perform the insert/replace in a single line ?
can't you just remove (HTTP::header remove) and then insert (HTTP::header insert)?
- for case where header is not present : would [HTTP::header remove] throw an error ?
- nitass_89166Noctilucentno
- so why does [HTTP::header replace] command exist ?
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