Forum Discussion
Kirk_Bauer_1018
Nimbostratus
Mar 31, 2007Can't get HTTP payload modification iRule to work
I have tried this rule, largely pieced together from sample code on this site:
when HTTP_REQUEST {
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
log local0. "$uri:...
Deb_Allen_18
Apr 03, 2007Historic F5 Account
Hey Kirk --
I've had good success collecting as much data as necessary, then using regsub against the collected data instead of having to calculate insertion points:
set payload [HTTP::payload]
set find "/intl/en_com/images/logo_plain.png"
set replace "http://kaybee.org:8080/google_f5.png"
regsub $find $payload $replace payload
HTTP::payload replace 0 [HTTP::payload length] $payload
In either case, though, if the content length is changing, you'll need to set the Response Chunking option in your http profile to "Re-Chunk" so LTM doesn't send out an incorrect Content-Length header(which can cause the browser to hang or otherwise act funky)
HTH
/deb
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