public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: John Hollowell <jhollowe@johnhollowell.com>
To: pve-devel@lists.proxmox.com
Cc: John Hollowell <jhollowe@johnhollowell.com>
Subject: [pve-devel] [PATCH http-server 1/1] fix #4344: http-server: ignore unused multipart headers
Date: Sun, 13 Nov 2022 23:48:10 +0000	[thread overview]
Message-ID: <20221113234810.6642-2-jhollowe@johnhollowell.com> (raw)
In-Reply-To: <20221113234810.6642-1-jhollowe@johnhollowell.com>

Signed-off-by: John Hollowell <jhollowe@johnhollowell.com>
---
 src/PVE/APIServer/AnyEvent.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
index f397a8c..d958642 100644
--- a/src/PVE/APIServer/AnyEvent.pm
+++ b/src/PVE/APIServer/AnyEvent.pm
@@ -1215,15 +1215,15 @@ sub file_upload_multipart {
 	    $extract_form_disposition->('checksum');

 	    if ($hdl->{rbuf} =~
-		s/^${delim_re}
-		Content-Disposition:\ (.*?);\ name="(.*?)";\ filename="([^"]+)"${newline_re}
-		Content-Type:\ \S*\s+
-		//sxx
+		s/^${delim_re}Content-Disposition:\ (.*?);\ name="(.*?)";\ filename="([^"]+)"//sxx
 	    ) {
 		assert_form_disposition($1);
 		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
 	    }
 	}

--
2.30.2



  reply	other threads:[~2022-11-13 23:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13 23:48 [pve-devel] [PATCH http-server 0/1] fix #4344: " John Hollowell
2022-11-13 23:48 ` John Hollowell [this message]
2022-11-14 10:33   ` [pve-devel] [PATCH http-server 1/1] fix #4344: http-server: " Matthias Heiserer
2022-11-16 10:05   ` Matthias Heiserer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221113234810.6642-2-jhollowe@johnhollowell.com \
    --to=jhollowe@johnhollowell.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal