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 { $method =="POST" and $clen > 1048576 } {
log local0. "over 1MB post: $uri - ($clen) [IP::client_addr]"
HTTP::respond 301 "Location" "http://[HTTP::host/errorpage.htm"
}
}
The problem with that is that it will only redirect after the whole POST is sent to the server, I'd like the iRule to interrupt the client and redirect it to the error page immediately.
So I tried adding HTTP::close or TCP::close after the HTTP::respond, but then I got "Document contains no data" errors on the client.
So, Is there a way to make this work ?
Thanks.
15 Replies
- Jari_Hyttinen_1
Nimbostratus
This rule works with IE6 but not with Mozilla based browsers. Why is that ? - Colin_Walker_12Historic F5 AccountIt's interesting that it won't work in Mozilla based browsers. It sounds like it has something to do with the way that the different browsers are handling the 307 response the BIG-IP is sending them. Mozilla isn't dropping immediately, which may have something to do with RFC adherence, but I'd have to dig more deeply into it to be sure.
- bl0ndie_127134Historic F5 AccountPlease try adding the 'reject' after the HTTP::redirect.
- bl0ndie_127134Historic F5 Accounts/HTTP::redirect/HTTP::respond
- Jari_Hyttinen_1
Nimbostratus
Hi,
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