Forum Discussion
Zuke
Jul 25, 2017Cirrostratus
Alright, problem solved. I finally got the escaped characters in the XML files to match and substitute like I wanted. Hopefully this helps someone else.
when RULE_INIT {
set static::search "http:\\\\\\\/\\\\\\\/oldapplicationdomain"
set static::replace "https:\\\/\\\/newapplicationdomain"
}
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
Check if response type is text
if {[HTTP::header value Content-Type] contains "text/xml"}{
Replace http:// with https://
STREAM::expression @${static::search}@${static::replace}@
Enable the stream filter for this response only
STREAM::enable
}
}