Forum Discussion
HTTP::Collect and HTTP::payload Not working
I got some problem,
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.
Can you please suggest ?
Thanks a lot in advance
Pradeep
16 Replies
- What_Lies_Bene1
Cirrostratus
Have you read the details here: https://devcentral.f5.com/wiki/iRules.HTTP__collect.ashx?
Can you post the iRule code please?
BTW it's HTTP_REQUEST_DATA.
- Pradeep_Kandala
Nimbostratus
when HTTP_REQUEST {
Log debug? 1=yes, 0=no
set debug 1
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]"
if {[HTTP::method] eq "POST"}{
set clength 0
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
}
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). - What_Lies_Bene1
Cirrostratus
And are your client's using the POST method or GET?
- Pradeep_Kandala
Nimbostratus
Yes - Pradeep_Kandala
Nimbostratus
Client is using post method - What_Lies_Bene1
Cirrostratus
OK and I assume the log entries show that the Content Length value is greater than 200?
Also, what version are you running? Could be a bug.
- Pradeep_Kandala
Nimbostratus
yes its 5677 - What_Lies_Bene1
Cirrostratus
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. - Pradeep_Kandala
Nimbostratus
1) TMOS version I will update tomorrow, As I'm not sure at this moment what this is.
2) Yes, It has same value.
3) Yes, Still I will confirm tomorrow.
4) Yes I tried, But no use. - What_Lies_Bene1
Cirrostratus
Thanks, 'talk' to you tomorrow.
Recent Discussions
Related Content
* 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
