Forum Discussion
HTTP header insertion using irules
Hi,
Need some help here, I am trying to insert a http header with value of another header in the same HTTP request, how do I do that?
E.g.
when HTTP_REQUEST { HTTP::header insert "User-Agent" [reference to another header value] }
2 Replies
- Vijay_E
Cirrus
Try this:
when HTTP_REQUEST { if { not (HTTP::header values eq "") } { set VALUE [HTTP::header values ] HTTP::header insert "User-Agent" $VALUE } Hi Splendid81,
you may use the iRule code below...
when HTTP_REQUEST { if { [HTTP::header values ""] ne "" } then { HTTP::header remove "" HTTP::header replace "" [HTTP::header values ""] } }Note: You may uncomment the HTTP::header remove "" line if security is a concern for you. Otherwise LTM will just replace/add a single occourence without checking if the same header name exist more than once.
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
