GaryZ_31658
Mar 28, 2006Historic F5 Account
Change Referer on inbound HTTP::header
I have an application that monitors the "Referer" in the header very specifically.
I need to change "https://domain.com/uri?important_server_data" TO "http://domain.com/uri?important_server_data"
Unfortunately, on each call, the "?important_server_data" changes.
Here is what I have:
when HTTP_REQUEST {
set refer [HTTP::header "Referer"]
set refer_var [findstr $refer "https://" 8 ":"]
if { [HTTP::header exists "Referer"] } {
HTTP::header replace "Referer" "http://$refer_var"
log local0. "refer_var=$refer_var"
}
}
I am not certain what the delimiter is (how far to go when extracting the data for refer_var.
In any case, this is not working very well... Any suggestions?
TIA
GaryZ