Forum Discussion
Thornid
Nimbostratus
Sep 13, 2019Modify HTTP Payload in Response Question
Hello all We have a requirement to modify the <HEAD> HTML tag in responses for a specific URL. I've been looking around trying to piece bits together but not having too much luck in the lab. My...
youssef1
Cumulonimbus
Sep 13, 2019Hi,
You can use my example with stream profile.
or modify your irule with the following code:
when HTTP_RESPONSE_DATA {
set find "<HEAD>"
set replace "<HEAD> SOME_OTHER_DATA"
if {[ regsub -all $find [HTTP::payload] $replace new_response] > 0} {
regsub -all $find [HTTP::payload] $replace newdata
log "Replacing payload with new data."
HTTP::payload replace 0 [HTTP::payload length] $newdata
HTTP::release
}
}
regards
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