Payload change if request is from specific IP/IP range
Hi All,
I am using irule to change the payload and i am able to see content is getting changed. Below is the irule. I want to change payload only when request is coming from a specific IP address. Kindly tell me how can i achieve it.
Irule currently in use.
when HTTP_REQUEST { HTTP::header remove "Accept-Encoding" switch [string tolower [HTTP::host]] { "123.domain.com" { pool 123-pool-tcp443 } "456.domain.com" { pool 456-pool-tcp443 } }} when HTTP_RESPONSE { if { [HTTP::header Content-Type] contains "text/xml" } { if { [HTTP::header exists "Content-Length"] } { set content_length [HTTP::header "Content-Length"] } else { set content_length 1000000 } if { $content_length > 0 } { HTTP::collect $content_length } } } when HTTP_RESPONSE_DATA { HTTP::payload replace 0 $content_length [string map {"InstallApplication" " "} [HTTP::payload]] HTTP::release }