I’m running 9.4.6 and trying the most basic stream replacement possible. I have set the default stream profile on the virtual server and am trying to use an iRule to do a replacement:
when HTTP_RESPONSE {
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains “text”}{
STREAM::expression “@test@blah@”
STREAM::enable
}
}
The response body contains “This is a test”
I did some logging and it does not find a match for “test”. Occasionally it will find a match when I use a single letter, and sometimes it messes up the response so I get page cannot be displayed. I’ve never got it to find a match with more than one letter as the target text.
There has to be something obvious I’m missing here. Any help is appreciated.
Is the response payload compressed? LTM won’t decompress the the response content, so you need to disable compression on the servers or remove the Accept-Encoding header from the request.
Thanks Aaron, that was it. IIS was set to compress the response. Apparently this is the default setting for web sites within IIS 7.5.
Rather than adding another configuration change that needs to be made any time we add or re-build servers in our SharePoint farm, I think the better approach would be to just remove the Accept-Encoding header on the request.