Forum Discussion
iRULE difference between strong tolower
What is the difference between both iRule usuage, and when is best to use this:
elseif {[HTTP::uri] contains "/testweb/" {pool TESTweb}
elseif {[string tolower [HTTP::uri]] contains "/testweb/" {pool TESTweb}
2 Replies
I would prefer the second one. The tolower command will convert all characters in HTTP:uri to lowercase characters before it is compared to '/testweb/'. This will cause variations like '/tEstWeb/' to also match.
Hi falooda,
the
syntax is the recommended approach, if a human is intended to type the URL into the address bar. In addition, this command is also recommended if you implement certain security controls (e.g. blacklists) and you want to make sure that a different /CaSE can not be used to bypass the policy...[string tolower [HTTP::uri]]The user/attacker may enter: https://www.domain.de/shorturl https://www.domain.de/Shorturl https://www.domain.de/ShortUrl https://www.domain.de/SHORTURLYour first iRule snippet will trigger only on the first example. And your second iRule snippet will trigger in any of the above URL examples.
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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