Hi Colin,
Thanks for getting back to me, Here is the iRule as it stands at present and it's the only iRule on my test VIP. It seems to work if I have an end marker that in the html output is quite near the first regex, so for example having my last match as a .+> seems to work as I hit that fairly quickly (hence my theory that line feeds / carriage returns are what's giving me difficulty).
when HTTP_RESPONSE {
HTTP::header remove server
foreach header {Server Date X-Powered-By} {
while { [HTTP::header exists $header] } {
log local0. "Removing- $header: [HTTP::header value $header]"
HTTP::header remove $header
}
}
Disable the stream filter by default
STREAM::disable
Check if response type is text
if {[HTTP::header value Content-Type] contains "text"}{
Match any http:// instance and replace it with nothing
STREAM::expression {@
.*>@} - This doesn't break the page
STREAM::expression {@comments.start.here.+comments.end.here@}
STREAM::expression {@comments.start.here.*comments.end.here@}
Enable the stream filter for this response only
STREAM::enable
}
}
when STREAM_MATCHED {
log local0. "matched: [STREAM::match]"
STREAM::replace "[string map {[^A-Za-z][bB][uU][sS][^A-Za-z] *******} [STREAM::match]]"
STREAM::replace "[string map {helloooooooo XXXXXXXXXXX} [STREAM::match]]"
}