]> git.proxmox.com Git - pve-http-server.git/commitdiff
multipart upload: code cleanup/reuse
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 6 Mar 2023 12:01:16 +0000 (13:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 6 Mar 2023 12:01:16 +0000 (13:01 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/APIServer/AnyEvent.pm

index f1e700aa28a7b60104fd637e39857d516ae95227..afbc3210835b975c90f582fbde94ffc5cf00171d 100644 (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
            }
        }