Forum Discussion
Oct 12, 2015
BIG-IP : iRule case-insensitive query-param matching
F5 BIG-IP Virtual Edition v11.4.1 (Build 635.0) LTM on ESXi
In my iRule I wish to identify the value of a query-param that may or may not be present.
I'm using this logic :
set myparam 0
s...
Hannes_Rapp
Nimbostratus
Using your sample, you can conver it to lower-case, before using the variable for any string comparisons: set myparam [string tolower [URI::query [HTTP::uri] myparam]]
Alternatively:
set myparam [string tolower [HTTP::query]]
In case of a request www.asd.fgh/asd?fFF=1, the code above would return "fff=1" (without the query question mark).
if you want to include the query question mark, use the code below which will return "?fff=1"
set myparam "?[string tolower [HTTP::query]]"
Oct 12, 2015
thanks Hannes but your understanding of the URI::query function does not match my own. My understanding is that 'URI::query uri-string query-param-name' returns 1 if "query-param-name=x" ( irrelevant of value of x ) is present in uri-string, and 0 if it's not.
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