Forum Discussion
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
}
}
- hoolio
Cirrostratus
Hi Darren, - Darren_21048
Nimbostratus
Thanks Aaron, that works nicely. I've raised an RFE request with F5, if I get an RFE ID. I'll post it. - hoolio
Cirrostratus
Thanks Darren. Please do post the RFE ID. - Darren_21048
Nimbostratus
The RFE ID is C850367. Also for info, I had to make a slight amendment to the statement.- ebeng_278441
Altocumulus
Any luck with the RFE? im also struggling at the moment with upper/lower case in the streams
Recent Discussions
Related Content
* 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