зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
4d51be8c89
Коммит
db78a50c81
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче