Forum Discussion

BaltoStar_12467's avatar
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 ?

  • 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)?

     

  • 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)?