Forum Discussion
Les_Marstaeller
Nimbostratus
Feb 08, 2006Case insensitivity in HTTP::uri
Hi,
I had the following irule that was deciding the pool to direct HTTP requests to the appropriate pool:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/abc"} {
pool abc
} elseif { [HTTP::uri] starts_with "/def"} {
pool def
} elseif { [HTTP::uri] starts_with "/ghi"} {
pool ghi }
}
My clients are reporting issues with putting http://www.domain.com/ABC (uri in capitals) that, of course the irule does not trigger on. I changed the rule to the following:
when HTTP_REQUEST {
if {{tolower[HTTP::uri] starts_with "/abc"}} {
pool abc
} elseif {{tolower[HTTP::uri] starts_with "/def"}} {
pool def
} elseif {{tolower[HTTP::uri] starts_with "/ghi"}} {
pool ghi }
}
Unfortuately these changes disable the site altogether. Is this because the "tolower" function is doing strange things to the preceding slash?
I have put additional statements in the irule for the moment that will trigger on lower case and additional statement that will trigger on upper case but this will not cover clients that type "/Abc" which I really would like to cater for. As always, any help will be very appreciated.
Thanks,
Les
Canberra, Australia.
- JRahm
Admin
Try this instead:when HTTP_REQUEST { if { [ string tolower [HTTP::uri] ] starts_with "/abc" } { use pool abc } elseif { [ string tolower [HTTP::uri] ] starts_with "/def" } { use pool def } elseif { [ string tolower [HTTP::uri] ] starts_with "/ghi" } { use pool ghi } }
- Les_Marstaeller
Nimbostratus
Hey citizen_elah, you're a genius!! - Yep, citizen is one sharp guy.
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