Forum Discussion
What_Lies_Bene1
Cirrostratus
Oct 01, 2013Re: Regex rule conversion to iRule
Off 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."
}
}
}
}
}
No RepliesBe the first to reply
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