Forum Discussion

JRahm's avatar
JRahm
Icon for Admin rankAdmin
Oct 22, 2007

Replacing rule login in a Profile

I am trying to eliminate an iRule for a particular applciation as most of the logic has been replaced in the application. The only piece remaining is replacing the host header with the X-Forwarded-For header:


if { [HTTP::header exists "X-Forwarded-Host"] } {
  HTTP::header replace "Host" [HTTP::header "X-Forwarded-Host"]
}

Can this be done in the http or httpclass profile? Any suggestions would be appreciated. I'll post back if I find it first.

2 Replies

  • Hey Citizen,

     

     

    The only (remote) option I could think of was the HTTP profile option for 'Header to Insert'. But the help notes don't make it look good:

     

     

    "Specifies a string that the system inserts as a header in an HTTP request. If the header exists already, the system does not replace it."

     

     

    The HTTP class object doesn't allow you to modify a request.

     

     

    I think you're stuck with an iRule if you want to rewrite an existing header with a customer header's value...

     

     

    Aaron
  • Yeah, I saw that, thought I'd give it a shot anyway. Thanks for the feedback. I hate having to stick such a minimal rule out there, but oh well.