Forum Discussion
Zuke_254875
Jul 19, 2017Altostratus
Issues modifying XML content with stream profile & iRule
I've taken an iRule from another DevCentral post and modified it to fit my application.
when HTTP_REQUEST {
Disable the stream filter for all requests
STREAM::disable
LTM does not uncompre...
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
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects