Forum Discussion
izac_189977
Nimbostratus
Apr 22, 2015iRule for stream processing url encoded payload
Hi all,
we are using am iRule for replacing http:// with https:// within the payload. Works very well so far. Now we have url encoded strings and I like to replace them as well replace http%3A%2F%2F with https%3A%2F%2F. I added the stream statement to my existing iRule, but it doesn't work. And it seems to break the first stream expression Any help would be great.
This is my iRule
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@http://@https://@}
STREAM::expression {@http%3A%2F%2F@https%3A%2F%2F@}
STREAM::enable
}
}
2 Replies
- nitass
Employee
can you try something like this?
e.g.
configuration [root@ve11c:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { STREAM::disable HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { if { [HTTP::header value Content-Type] contains "text"} { STREAM::expression {@http://@https://@@http%3A%2F%2F@https%3A%2F%2F@} STREAM::enable } } } test (to server directly) [root@ve11c:Active:In Sync] config curl http://200.200.200.101/test.html line1 hello world line2 http://www.google.com/ line3 http%3A%2F%2Fwww.google.com%2F line4 end test (via virtual server) [root@ve11c:Active:In Sync] config curl http://172.28.24.10/test.html line1 hello world line2 https://www.google.com/ line3 https%3A%2F%2Fwww.google.com%2F line4 end - izac_189977
Nimbostratus
Ha awsome, my hero, it works :) Thanks for the quick help @nitass!
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