Forum Discussion
johns
Employee
Mar 02, 2006iRule recognize blank space in URI?
Hi, I need to detect blank space in URI and either remove it or rewrite it:
www.mysite.com/some content/showme.html
to
www.mysite.com/some%20content/showme.html
...
johns
Employee
Mar 27, 2006What about below?
when CLIENT_ACCEPTED {
TCP::collect 300
}
when CLIENT_DATA {
set matchedURI [regexp -inline "/vMoD.+HTTP" [TCP::payload]]
if { [string length $matchedURI] > 0 } {
set newURI [getfield [getfield $matchedURI " HTTP" 1] "\{" 2]
log local0. "URI was matched. Result: $newURI"
set preencURI [TCP::payload replace 0 [TCP::payload] $newURI]
set encURI [string map { " " %20} $preencURI]
log local0. "encURI is $encURI"
} else {
log local0. "no match"
set uriRewrite 0
}
}
when HTTP_REQUEST {
if {$uriRewrite == 1} {
HTTP::uri $encURI
log local0. "It worked! [HTTP::uri]"
}
}
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
