Abdulmohsen_Mut
Mar 22, 2006Nimbostratus
Deny Large file download using HTTP::conent-Length
Hi,
I am trying to implement something similar to the one in the thread titled :redirect POSTs bigger than 1MB
http://devcentral.f5.com/Default.aspx?tabid=28&forumid=5&postid=5411&view=topic
We need to intercept responses to large file download request and close the HTTP session before the download starts. However, i am worried that this will impact the performance of our proxies as thousands of users will be going through the BIG-IP in front of the proxy servers.
Also, I need to send the user a small warning html that tell him that downloading files > 50MB is not allowed, by re-writing the payload.
I am thinking of something like:
when HTTP_RESPONSE {
set clen [HTTP::header Content-Length]
if { $clen > 50,000,000} {
HTTP::payload replace 0 [HTTP::payload length] $warning_response
HTTP::close
}
log local0. "HTTP_RESPONSE CLEN= $clen "
}
Please advise on how to achieve this with minimum impact on performance. I am worried that enabling this iRule will cause the BIG-IP to read every HTTP meassage to look for Content-Length. Is there a way to read only required messages ??
Your support is highly appreciated.