Forum Discussion
João_Assad_4295
Nimbostratus
Nov 14, 2005redirect POSTs bigger than 1MB
Hello,
I'd like to redirect POSTs bigger than 1MB to an error page, so I tried this:
when HTTP_REQUEST {
set method [HTTP::method]
set clen [HTTP::header Content-Length]
if { $metho...
Jari_Hyttinen_1
Nimbostratus
Mar 30, 2006Hi,
Finally I got this iRule working. The issue was to use discard not reject.
I don't excatly know the difference between these two commands,
but now it works almost great.
Now I have noticed that if client tries to send much more bigger file
(actually over 140 kilobytes) HTTP::respond does not work correctly.
I have added logging statements to the iRule and it seems to me that every step goes OK.
I have check the request log from the web server behind Big-IP
that the POST request has been discard by Big-IP. That is great,
but I want to send a real response to the client.
What could cause this behaviour?
Here is my current iRule:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/upload" } {
set method [HTTP::method]
set clen [HTTP::header Content-Length]
if { $method =="POST" and $clen > 133120 } {
log local0. "Over 130 kb post: ($clen) from [IP::client_addr]"
discard
HTTP::close
HTTP::respond 307 "Location" "http://www.mydomain.com/xxx.html"
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects