In a reply to my post here, Hero Zzyzzx asked how a more custom error handling response for over-sized requests could be incorporated into code - The result, with some liberties taken from the CGI module, is the code below:
#!/usr/bin/perl -Tw use CGI; use strict; BEGIN { my $POST_MAX = 512 * 1024; my $content_length = defined $ENV{'CONTENT_LENGTH'} ? $ENV{'CONTEN +T_LENGTH'} : 0; if ( ($POST_MAX > 0) && ($content_length > $POST_MAX) ) { # custom request entity too large error handling } }
In reply to Custom error handling for oversized CGI request entities by rob_au
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |