Forum Discussion
danielng_19608
May 04, 2009Nimbostratus
Hi Aaron,
this is what i came out with. Basically, i am trying to match another condition that is any string which contains what i have specified in the datagroup selectedSites will be checked. I tried to specify selectedSites as a String datagroup but it doesnt seem to be working. Any advise on this?
=================================================================================
if {[matchclass [IP::client_addr] equals $::trustedAddresses]}
{
set insertxff 0
}
else
{
set insertxff 1
}
}
when HTTP_REQUEST {
if { $insertxff equals 0 and ([string tolower [HTTP::host]] contains $::selectedSites)}
{
Remove existing XFF headers if both conditions match
HTTP::header remove X-Forwarded-For
}
else
{
Insert new XFF header
HTTP::header insert X-Forwarded-For [IP::remote_addr]
}
}