Robert_47833
May 27, 2015Altostratus
[HTTP::payload] in event HTTP_REQUEST_DATA only respresent data collected or the whole http payload?
hi,dear irule
1:HTTP::collect $content_length collects up to 1MB of data,how to call this data?
2:[HTTP::payload] in event HTTP_REQUEST_DATA only respresent 1MB data or the whole http payload?
when HTTP_REQUEST {
if {[HTTP::method] eq "POST"}{
Trigger collection for up to 1MB of data
if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048576}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
Check if $content_length is not set to 0
if { $content_length > 0} {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
set payload [HTTP::payload]