Report an internal error when we have a malformed submission. Really we should return an error 400 but that can wait.

This commit is contained in:
ian%hixie.ch 2004-02-25 19:19:51 +00:00
Родитель 4d51be8c89
Коммит db78a50c81
1 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -68,13 +68,19 @@ sub decodeHTTPArguments {
$self->dump(9, 'HTTP POST. Input was in multipart/form-data format.');
# parse the MIME body
local $/ = undef;
my $data = 'Content-Type: ' . $self->{CONTENT_TYPE} . "\n" .
'Content-Length: ' . $self->{CONTENT_LENGTH} . "\n" .
"\n" . <STDIN>;
$self->dump(9, "Data was:\n==============================\n$data\n==============================");
my $entity = $parser->parse_data($data);
my $entity;
eval {
# parse the MIME body
local $/ = undef;
my $data = 'Content-Type: ' . $self->{CONTENT_TYPE} . "\n" .
'Content-Length: ' . $self->{CONTENT_LENGTH} . "\n" .
"\n" . <STDIN>;
$self->dump(9, "Data was:\n==============================\n$data\n==============================");
$entity = $parser->parse_data($data);
};
if ($@) {
$self->error(1, "malformed submission: $@");
}
# handle the parts of the MIME body
# read up to 16KB, no more