mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-12 15:16:52 +00:00
fix: percent-encode ';' in form values
PveHttpClient.EncodeFormValue encoded &, =, +, space, and % but left ';'
literal. PVE's application/x-www-form-urlencoded parser treats a raw ';'
as a field separator (the historical alternative to '&'), so a value like
boot=order=scsi0;ide2
was split into 'boot=order=scsi0' plus an empty 'ide2' field, and PVE
rejected the PUT with "ide2: unable to parse drive options". This broke
any multi-device boot order set via Set-PveVmConfig -AdditionalConfig,
and any other value containing ';'.
Encode ';' as %3B. Safe under the existing minimal-encoding policy that
keeps ':' and '!' literal for cluster-join: cluster-join payloads never
contain ';', and PVE url-decodes config form values.
Tracked as F088. Closes #64.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -169,6 +169,11 @@ namespace PSProxmoxVE.Core.Client
|
||||
{
|
||||
case '&': sb.Append("%26"); break;
|
||||
case '=': sb.Append("%3D"); break;
|
||||
// PVE's form parser treats a raw ';' as a field separator (the
|
||||
// historical alternative to '&'), so an unencoded ';' inside a value
|
||||
// (e.g. boot=order=scsi0;ide2) splits the value into bogus extra
|
||||
// fields. Encode it so the value arrives intact.
|
||||
case ';': sb.Append("%3B"); break;
|
||||
case '+': sb.Append("%2B"); break;
|
||||
case ' ': sb.Append('+'); break;
|
||||
case '%': sb.Append("%25"); break;
|
||||
|
||||
Reference in New Issue
Block a user