Stream::expression & case insenitivity
I am trying to create a bit of a badword list and as a test intend to use this iRule. It works fine but I'm struggling to add case insensitivity to the mix. I've tried wrapping [string tolower] round it with no success and have read I may need to use a regex but wonder if there is a better way.
Any suggestions much appreciated.
Thanks.
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"}{
Replace content in STREAM expression
STREAM::expression "@badword@*****@ @badword2@*****@ @badword3@*****@" ]
Enable the stream filter for this response only
STREAM::enable
}
}