Forum Discussion
mahnsc
Nimbostratus
Mar 22, 2013switch -glob (or -regexp) for multiple directories
I have some URLs that I want to match in a switch statement and I'm having trouble matching those cases where multple slashes appear before the uri name. For example:
/uri //uri ////uri /com...
nitass
Employee
Mar 22, 2013sorry i may be lost but can't we just check double slash (//) or more?
e.g.
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"/uri" -
"//*" { log local0. "[HTTP::path] is rejected"; reject }
default { log local0. "[HTTP::path] is allowed" }
}
}
}
[root@ve10:Active] config cat /var/log/ltm
Mar 23 07:06:24 local/tmm info tmm[4950]: Rule myrule : / is allowed
Mar 23 07:06:27 local/tmm info tmm[4950]: Rule myrule : /uri is rejected
Mar 23 07:06:29 local/tmm info tmm[4950]: Rule myrule : //uri is rejected
Mar 23 07:06:33 local/tmm info tmm[4950]: Rule myrule : ///uri is rejected
Mar 23 07:06:47 local/tmm info tmm[4950]: Rule myrule : /completely/valid/uri is allowed
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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