Forum Discussion
Scott_Larson
Nimbostratus
Aug 17, 2007Regexp to scrub http response data payload
I'm trying to write an iRule with a regexp that will scour outgoing HTTP payloads and replace http with https and remove any port (and the colon preceeding the port number) - that is, scrub all outgoi...
hoolio
Cirrostratus
Aug 20, 2007If you know what ports are referenced in the HTTP content you might be able to use a stream profile to perform the replacement using fewer resources than buffering the response data and doing a regsub.
Here is an example:
when HTTP_RESPONSE {
STREAM::enable
STREAM::expression @http://www.example.com:80@http://www.example.com@@https://www.example.com:443@https://www.example.com@
}The format for the stream expression is @search1@replace1@@search2@replace2@@
See the wiki page for stream (Click here) and this post for more info (Click here).
Aaron
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
