multipart upload: fix upload of files starting with newlines

Currently, if a file starts with a newline, it gets removed and the
upload succeeds (provided no hash is given).

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Reviewed-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Tested-by:  Daniel Tschlatscher <d.tschlatscher@proxmox.com>
This commit is contained in:
Matthias Heiserer 2022-12-12 16:07:54 +01:00 committed by Thomas Lamprecht
parent 7a6657f0d1
commit 26ea294acd

View File

@ -1217,7 +1217,7 @@ sub file_upload_multipart {
if ($hdl->{rbuf} =~
s/^${delim_re}
Content-Disposition:\ (.*?);\ name="(.*?)";\ filename="([^"]+)"${newline_re}
Content-Type:\ \S*\s+
Content-Type:\ \S*${newline_re}{2}
//sxx
) {
assert_form_disposition($1);