mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-05-03 20:35:39 +00:00
fix #4344: http-server: ignore unused multipart headers
In commit 0fbcbc2
("fix #3990: multipart upload: rework to fix
uploading small files") a breaking change was added which now
requires the file's multipart part to have a `Content-Type` even
though the content type is never used. It is just included to consume
those bytes so phase 2 (dumping the file contents into the file) can
continue.
Avoid this overly strict and unused requirement.
Signed-off-by: John Hollowell <jhollowe@johnhollowell.com>
[ T: resolve merge conflict, add telling commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
44791210d7
commit
3e3faddb4a
@ -1223,15 +1223,15 @@ sub file_upload_multipart {
|
|||||||
$extract_form_disposition->('checksum');
|
$extract_form_disposition->('checksum');
|
||||||
|
|
||||||
if ($hdl->{rbuf} =~
|
if ($hdl->{rbuf} =~
|
||||||
s/^${delim_re}
|
s/^${delim_re}Content-Disposition:\ (.*?);\ name="(.*?)";\ filename="([^"]+)"${newline_re}//sxx
|
||||||
Content-Disposition:\ (.*?);\ name="(.*?)";\ filename="([^"]+)"${newline_re}
|
|
||||||
Content-Type:\ \S*${newline_re}{2}
|
|
||||||
//sxx
|
|
||||||
) {
|
) {
|
||||||
assert_form_disposition($1);
|
assert_form_disposition($1);
|
||||||
die "wrong field name '$2' for file upload, expected 'filename'" if $2 ne "filename";
|
die "wrong field name '$2' for file upload, expected 'filename'" if $2 ne "filename";
|
||||||
$rstate->{phase} = 2;
|
$rstate->{phase} = 2;
|
||||||
$rstate->{params}->{filename} = trim($3);
|
$rstate->{params}->{filename} = trim($3);
|
||||||
|
|
||||||
|
# remove any remaining multipart "headers" like Content-Type
|
||||||
|
$hdl->{rbuf} =~ s/^.*?${newline_re}{2}//s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user