Forum Discussion
Mark_Porter_979
Nimbostratus
Oct 12, 2005Percent character encoding and irules
I have an irule that looks at the request_uri to determine which pool to use:
if (http_uri matches_regex "/[Vv][Ee][Nn][Dd][Oo][Rr]_[Mm][Gg][Tt]") {
use pool lm-pmweb-2k3
}
else {
use pool lm-web-prod
}
The problem is that the 2k3 IIS devices are building a redirect to add the trailing / onto the directory name, but encoding the _ character.
If I request http://site.d.com/vendor_mgt, IIS responds with a 302, and sends me to http://site.d.com/vendor%5Fmgt/ . The problem is that by replacing the _ with a %5F, the irule doesn't match any longer, and I go to the wrong pool.
Is there a way to make the irule decode the %5F so that it will match?
- Colin_Walker_12Historic F5 AccountI'd suggest making a change like:
if (http_uri matches_regex "/[Vv][Ee][Nn][Dd][Oo][Rr].*[Mm][Gg][Tt]") { use pool lm-pmweb-2k3 } else { use pool lm-web-prod }
- Martin_MachacekHistoric F5 AccountMark,
rule match_vendor_mgt { if(tolower(decode_uri(http_uri)) == "/vendor_mgt") use pool lm-pmweb-2k3 } else { use pool lm-web-prod } }
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