Forum Discussion
JamesS_40157
Nimbostratus
Aug 21, 2012HTTP::collect and HTTP::payload corrupt?
Hi, I am trying to create an iRule that, when a response is sent back to the client (the client initiates a GET request for a file, in this case an image), it will collect the body. The iRul...
JamesS_40157
Nimbostratus
Aug 21, 2012I have since modified the HTTP_RESPONSE_DATA to look inside the payload:
when HTTP_RESPONSE_DATA {
if { $debug>=3 } { log local0.info "HTTP_RESPONSE_DATA triggered for castoruri $castoruri" }
set payload [HTTP::payload]
binary scan [HTTP::payload] H* payload_hex
This POSTs back through the iRule like a client request, and so the iRule will trigger HTTP_REQUEST again
if { $debug>=3 } {log local0.info "REQUEST IS POST $original_path HTTP/1.1\r\nHost: $original_castordomain\r\nContent-Length: $contentlength\r\n\r\n$payload" }
HTTP::retry "POST $original_path HTTP/1.1\r\nHost: $original_castordomain\r\nX-Forwarded-Host: $original_castordomain\r\nContent-Length: $contentlength\r\n\r\n$payload\r\n"
HTTP::respond 200 content "
$payload_hex
"
}
I have compared the output in my browser with the hex dump of the original file and they are identical, which is a good sign! So it must be something to do with the POST request that is corrupting it..hmm
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