mirror of
https://git.proxmox.com/git/pve-http-server
synced 2025-04-30 15:57:56 +00:00
multipart upload: ignore trailing-newline requirement from spec
Allow upload without trailing newline, even though this is not compliant with RFC 1521. RFC 1521 mandates that the close-delimiter ends in a newline: 'close-delimiter := "--" boundary "--" CRLF' However, some software (e.g. postman) sends their request without a trailing newline, which resulted in failing uploads. 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:
parent
e3295acc78
commit
44791210d7
@ -1193,7 +1193,7 @@ sub file_upload_multipart {
|
||||
|
||||
my $newline_re = qr/\015?\012/;
|
||||
my $delim_re = qr/--\Q$boundary\E${newline_re}/;
|
||||
my $close_delim_re = qr/--\Q$boundary\E--${newline_re}/;
|
||||
my $close_delim_re = qr/--\Q$boundary\E--/;
|
||||
|
||||
# Phase 0 - preserve boundary, but remove everything before
|
||||
if ($rstate->{phase} == 0 && $hdl->{rbuf} =~ s/^.*?($delim_re)/$1/s) {
|
||||
|
Loading…
Reference in New Issue
Block a user