multipart upload: code cleanup/reuse

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-03-06 13:01:16 +01:00
parent 0b6b3b372b
commit 435dbe0c06

View File

@ -1227,9 +1227,7 @@ sub file_upload_multipart {
die "wrong field name '$2' for file upload, expected 'filename'" if $2 ne "filename";
$rstate->{phase} = 2;
$rstate->{params}->{filename} = trim($3);
# remove any remaining multipart "headers" like Content-Type
$hdl->{rbuf} =~ s/^.*?${newline_re}{2}//s
$remove_until_data->($hdl); # any remaining multipart "headers" like Content-Type
}
}