[pve-devel] [PATCH http-server v2 2/2] remove dead code 'parse_content_disposition'

Dominik Csapak d.csapak at proxmox.com
Mon Nov 7 16:07:50 CET 2022


our recent change to parsing the upload headers made that code
unnecessary, so remove it

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/APIServer/AnyEvent.pm | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
index 39061ad..f397a8c 100644
--- a/src/PVE/APIServer/AnyEvent.pm
+++ b/src/PVE/APIServer/AnyEvent.pm
@@ -1280,26 +1280,6 @@ sub parse_content_type {
     return  wantarray ? ($ct) : $ct;
 }
 
-sub parse_content_disposition {
-    my ($line) = @_;
-
-    my ($disp, @params) = split(/\s*[;,]\s*/o, $line);
-    my $name;
-    my $filename;
-
-    foreach my $v (@params) {
-	if ($v =~ m/^\s*name\s*=\s*(\S+?)\s*$/o) {
-	    $name = $1;
-	    $name =~ s/^"(.*)"$/$1/;
-	} elsif ($v =~ m/^\s*filename\s*=\s*(.+?)\s*$/o) {
-	    $filename = $1;
-	    $filename =~ s/^"(.*)"$/$1/;
-	}
-    }
-
-    return  wantarray ? ($disp, $name, $filename) : $disp;
-}
-
 my $tmpfile_seq_no = 0;
 
 sub get_upload_filename {
-- 
2.30.2






More information about the pve-devel mailing list