mirror of
https://github.com/GoodOlClint/PSProxmoxVE.git
synced 2026-08-11 14:56:53 +00:00
fix(auth): use TryAddWithoutValidation for Authorization header
.NET's HttpHeaders.Add() validates the Authorization header value against the HTTP spec, rejecting PVE's custom PVEAPIToken scheme that contains @, !, and = in the token string. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -280,7 +280,7 @@ namespace PSProxmoxVE.Core.Client
|
||||
|
||||
if (_session.AuthMode == PveAuthMode.ApiToken)
|
||||
{
|
||||
request.Headers.Add("Authorization", $"PVEAPIToken={_session.ApiToken}");
|
||||
request.Headers.TryAddWithoutValidation("Authorization", $"PVEAPIToken={_session.ApiToken}");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user