I wish to set the Host Header to the first value in the X-Forwarded-Host header. Any suggestions on how to best achieve this.
We wrote the code below but it did not work. Can you please assist in resolving the same?
when HTTP_REQUEST { set xff_list ‘’ set x 0 set newheader ‘’ if {[HTTP::header values X-Forwarded-Host] ne “”} { set xff_list [split [HTTP::header values X-Forwarded-Host] “,”]
newheader::[lindex $xff_list $x] newheader::[string trimleft [$newheader] 1] [HTTP::header replace “Host” [$newheader]]
}