Eduardo_Saito_1
Jan 09, 2009Nimbostratus
Modifying HTTP REQUEST DATA
Hello guys.
Every iRule I've made that need to access HTTP_RESPONSE_DATA I used the following code:
when HTTP_REQUEST {
No Chunk
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1000000000
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
when HTTP_RESPONSE_DATA {
log local0. "[HTTP::payload]"
HTTP::release
}
But now I have to access the HTTP_REQUEST_DATA instead. The irule I've made looks like this one:
when HTTP_REQUEST {
No Chunk
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
Colect Content_length
set clen [HTTP::header Content-Length]
if { not [info exists clen] or "" eq $clen } {
set clen 1000000000
}
HTTP::collect $clen
}
when HTTP_REQUEST_DATA {
log local0. "[HTTP::payload]"
HTTP::release
}
It is working for the majority of the customers but some customers are complaining about not being able to reach WebServices (SOAP/XML). Their logs show connection reset.
The question is: Do I have to make a HTTP::version check at the HTTP_REQUEST even though I'm just interested in the HTTP_REQUEST_DATA? What might be the problem here?
Thanks for helping me.