]> git.proxmox.com Git - pve-http-server.git/commitdiff
use proper arrays for array parameter
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 6 Jun 2023 13:08:49 +0000 (15:08 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 7 Jun 2023 11:16:57 +0000 (13:16 +0200)
since there is no other way to get an array parameter when using
x-www-form-urlencoded content type

the previous format with \0 separated strings (known as '-alist' format)
should not be used anymore (in favor of the now supported arrays)

Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/APIServer/AnyEvent.pm

index 59da46619392aae6ecb02717c6fac439edf7c064..6831a8656290bfd1fcfe1b92cd8970a30bedfc2b 100644 (file)
@@ -850,7 +850,12 @@ sub decode_urlencoded {
            $v = Encode::decode('utf8', $v);
 
            if (defined(my $old = $res->{$k})) {
-               $v = "$old\0$v";
+               if (ref($old) eq 'ARRAY') {
+                   push @$old, $v;
+                   $v = $old;
+               } else {
+                   $v = [$old, $v];
+               }
            }
        }