Forum Discussion
mtobkes_108891
Apr 13, 2011Nimbostratus
Error with or operator
Hi,
I'm having issues with this iRule when trying to match multiple strings using the or operator. Oddly enough I don't get the error in line 2 but I do in line 4. Can you please tell me h...
hooleylist
Apr 14, 2011Cirrostratus
Hi Myles,
You need to perform the full check against the URI as string tolower doesn't accept multiple strings.
if { ([string tolower [HTTP::uri]] contains "font") && ([string tolower [HTTP::uri]] ends_with ".eot" || ".ttf") } {
->
if { ([string tolower [HTTP::uri]] contains "font") && ([string tolower [HTTP::uri]] ends_with ".eot" || [string tolower [HTTP::uri]] ends_with ".ttf") } {
If you're doing this many checks on the URI, you should save the lowercase value in a variable:
set uri [string tolower [HTTP::uri]]
if { ( $uri contains "font") && ($uri ends_with ".eot" || $uri ends_with ".ttf") } {
Aaron
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