Forum Discussion
Lee_Sutcliffe
Aug 22, 2018Nacreous
This is an amended version, if there is only a first name (second field is "test1") then is will only add the first name. If not, it will add the first two fields to the new host header.
when HTTP_REQUEST {
set field1 [getfield [HTTP::host] “.” 1]
set field2 [getfield [HTTP::host] “.” 2]
if {$field2 eq "test1"} {
HTTP::header replace "Host" ${hostField}.test2.mycompany.com
} else {
HTTP::header replace "Host" ${field1}.${field2}.test2.mycompany.com
}
}