Forum Discussion
Jamey_Price_105
Nimbostratus
Jan 31, 2005HTTP::payload replacing content
I'm basing this rule off a thread I found at http://devcentral.f5.com/default.aspx?tabid=28&view=topic&forumid=5&postid=1521
Basically, we have chunks of our site running on multiple se...
Jamey_Price_105
Nimbostratus
Feb 01, 2005So far, it's not quite working still. I've been screwing with it, adding some more checking and logging to see where it's blowing up, and this is where I'm at now.
when HTTP_RESPONSE_DATA {
set nummatches [regexp -nocase "oursite" [HTTP::payload]]
if { $nummatches }{
regsub "oursite.ourdomain.com" [HTTP::payload] "oursitedev.ourdomain.com" fixeddata
log "Replacing payload $nummatches times."
HTTP::payload replace 0 $clen $fixeddata
} else {
log "No payload will be replaced."
}
HTTP::release
}
I tried escaping the periods in case they were being interpreted to match any character (which shouldn't matter regardless, but I'm grasping at straws here), and then I shortened what I'm searching for in the regexp to just the oursite bit of the full oursite.ourdomain.com to see if it's even matching, and it does not appear that that is matching at all.
I believe we are compressing the response data on the server, do I need to disable that, or decompress it somehow, before I do anything with it in an iRule? All my logs have to say about this is "No payload will be replaced."
Thanks again, this has been a great help. I'm getting there, but I've just not quite made it yet.
Jamey
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