Forum Discussion
Patti_G_72768
Nimbostratus
Oct 01, 2013Regex rule conversion to iRule
Hi all, I'm a newbie and have been working on converting a regex rule to an iRule. I wanted to reach out to the community to see if I can get some help with what I have written so far. The regex rule...
What_Lies_Bene1
Cirrostratus
Oct 01, 2013Off in quite a few ways I'm afraid but nothing too bad. Here's my version, untested. I've never nested switch statements so it might not work, if not, there's lots of other ways to do it;
when HTTP_REQUEST {
switch [HTTP::method] {
"GET" -
"HEAD" -
"PROPFIND" -
"OPTIONS" {
switch [HTTP::header "Content-Type"] {
":application/x-www-form-urlencoded; charset = " -
":multipart/form-data;" -
":text/xml" {
log local0. "Request content type is not allowed by policy."
HTTP::respond 501 content "Request content type is not allowed by policy."
}
}
}
}
}
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