In HTTP::request I’m able to collect only upto 200 bytes using HTTP::collect 200 , if I’m specifying the full body length with full number or using Content-Length of HTTP::header it is not working.
In HTTP_DATA_REQUEST only able to collect payload of 200 anything above it is not working.
This is the code, I have read the link material, But could not solve. and this code is working for small amount of data(200) but not for 5500(which I require).
1) OK, please supply your TMOS version, it could be a bug.
2) I take it you see that same value reported by the log statements in both the REQUEST and REQUEST_DATA events?
3) I assume the Virtual Server has a HTTP Profile assigned?
4) Have you tried not restricting the HTTP::payload command value? Just use: set SAMLResponse [HTTP::payload] instead of set SAMLResponse [HTTP::payload [HTTP::header “Content-Length”]] - it will then just return whatever is collected.
I’m sorry but I’m almost out of ideas with just the possibility of a software bug if you can provide a version number. Do you have a support contract in place?
Is the request chunked or does it not have a content length header? Can you try this version with a bit more debug and reply with the sanitized logs from /var/log/ltm?
when HTTP_REQUEST {
Collect up to the first 1MB of POST data
log local0. "Checking post method [HTTP::method] uri: [HTTP::uri] http_version: [HTTP::version] IP: [IP::client_addr]"
log local0. "Headers: [HTTP::request]"
if {[HTTP::method] eq "POST"}{
Check if there is a content-length header and the value is set to less than 1Mb
if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
set clength [HTTP::header "Content-Length"]
} else {
set clength 1048576
}
log local0. "Checking content length $clength IP: [IP::client_addr]"
if { $clength > 0} {
if {$debug}{log local0. "[virtual name]: Collecting $clength bytes IP: [IP::client_addr]"}
HTTP::collect [HTTP::header "Content-Length"]
}
}
}
when HTTP_REQUEST_DATA {
if {$debug}{log local0. "Collecting payload [HTTP::header "Content-Length"] IP: [IP::client_addr]"}
set SAMLResponse [HTTP::payload [HTTP::header "Content-Length"]]
log local0. "saml response : $SAMLResponse IP: [IP::client_addr] "
HTTP::release
}
Im experiencing same issue as well.Do we’ve any fix for it. when HTTP_REQUEST { if {[HTTP::method] eq “POST” && [string tolower [HTTP::path]] contains “tealeaftarget” }{ Trigger collection for up to 12K of data if {[HTTP::header “Content-Length”] ne “” && [HTTP::header “Content-Length”] <= 12228}{ set content_length [HTTP::header “Content-Length”] } else { set content_length 12228 } Check if $content_length is not set to 0 if { $content_length > 0} { HTTP::collect $content_length } } } when HTTP_REQUEST_DATA { do stuff with the payload set count [string length [HTTP::payload]] set response “received a total of $count of a planned $content_length bytes” HTTP::respond 200 content $response }
Error is as below. TCL error: IRULE NAME - Operation not supported (line 1) invoked from within “HTTP::collect $content_length”