Forum Discussion
Cody_Conklin_17
Nimbostratus
Aug 11, 2005iRule variable match is case sensitive
I have an iRule that behaves normally:
if (http_uri starts_with "/authentication") {
use pool IIS_Pool_80
}
else if (http_uri starts_with "/certapp") {
use pool IIS_Pool_80
}
else if (http_uri starts_with "/lms") {
use pool IIS_Pool_80
}
else {
use pool beta.xyz.com
}
Unfortunately, it does not work if a user accidentally goes to the URI "/Authentication". How do a make the variable match be case insensitive? Regardless of whether a user types "/Authentication" or "/authentication", it should direct to IIS_Pool_80.
- Colin_Walker_12Historic F5 AccountCody,
- Cody_Conklin_17
Nimbostratus
BIG-IP Kernel 4.5.12 Build19-a - Cody_Conklin_17
Nimbostratus
hmmm....I didn't really like the way that iRule was written, so I decided to consolidate it down to a single "if" statement, as follows: - Colin_Walker_12Historic F5 AccountCody,
- Are you sure it is case insensitive or is it just allowing everything in. I'll have to check with the iRules 4.x implementation of starts_with but I believe that the logical "or" operators are not working the way you think.
if ( (http_uri starts_with "/authentication") or ("/certapp") or ("/lms") ) { use pool IIS_Pool_80 } else { use pool beta.xyz.com }
or ("/certapp")
- Cody_Conklin_17
Nimbostratus
You're absolutely right Joe. All conditions are now matching, so nothing is using the "else" pool. - Martin_MachacekHistoric F5 AccountThe "tolower" function converts a string to lowercase, it does not make string match case insensitive.
if (tolower(http_uri) starts_with "/authentication") { use pool IIS_Pool_80 } else { use pool beta.pmi.org }
class allowed_uris { "/certapp" "/authentication" "/lms" } rule r1 { if(tolower(http_uri) starts_with one of allowed_uris) { use pool IIS_Pool_80 } else { use pool beta.pmi.org } }
- Colin_Walker_12Historic F5 AccountCody,
- Mark_Porter_979
Nimbostratus
Hi Colin, - Christopher_Ach
Nimbostratus
Hi
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