Forum Discussion
Frank_J_104756
Oct 31, 2007Historic F5 Account
HTTP::payload replace
I have 2 needs...1 to replace/hide the server in the http redirects that are being sent by the node. 2) to replace/hide the server in the actual content.
when HTTP_RESPONSE {
if...
Frank_J_104756
Oct 31, 2007Historic F5 Account
so irule now looks like
when HTTP_RESPONSE {
if { [LB::server addr] eq "10.0.19.50" } {
HTTP::header replace Location [string map {nwte1jas7:8882 bob} [HTTP::header Location]]
log "replacing nwte1jas7:8882 in header with bob" }
elseif { [LB::server addr] eq "10.0.19.42" } {
HTTP::header replace Location [string map {nwte1jas6:8882 bob} [HTTP::header Location]]
log "replacing nwte1jas7:8882 in header with bob" }
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"] }
else {
set content_length 1000000 }
if { $content_length > 0 } {
HTTP::collect $content_length }
}
when HTTP_RESPONSE_DATA {
if { [LB::server addr] eq "10.0.19.50" } {
regsub -all "nwte1jas7:8882" [HTTP::payload] "bob" newdata
log "Replacing nwtejas7:8882 with bob in the payload."
HTTP::payload replace 0 $content_length [string map {nwte1jas7:8882 bob} [HTTP::payload]]
HTTP::release }
elseif { [LB::server addr] eq "10.0.19.42" } {
regsub -all "nwte1jas6:8882" [HTTP::payload] "bob" newdata
log "Replacing nwtejas6:8882 with bob in the payload."
HTTP::payload replace 0 $content_length [string map {nwte1jas7:8882 bob} [HTTP::payload]]
HTTP::release }
}
I'm seeing error in log shown below
TCL error: Rule jas_redirect2 HTTP_RESPONSE_DATA - Out of bounds line 1 invoked from within HTTP::payload replace 0 $content_length [string map {nwte1jas7:8882 bob} [HTTP::payload]]
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
