From 625a56b75e9f084f999829580fe5980443d090a8 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 30 Oct 2020 13:34:21 +0100 Subject: [PATCH] server/rest: accept also = as token separator Like we do in Proxmox VE Signed-off-by: Thomas Lamprecht --- src/server/rest.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/rest.rs b/src/server/rest.rs index 8ee3e77b..b7114d7d 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -569,8 +569,12 @@ fn extract_auth_data(headers: &http::HeaderMap) -> Option { } match headers.get(header::AUTHORIZATION).map(|v| v.to_str()) { - Some(Ok(v)) if v.starts_with("PBSAPIToken ") => { - Some(AuthData::ApiToken(v["PBSAPIToken ".len()..].to_owned())) + Some(Ok(v)) => { + if v.starts_with("PBSAPIToken ") || v.starts_with("PBSAPIToken=") { + Some(AuthData::ApiToken(v["PBSAPIToken ".len()..].to_owned())) + } else { + None + } }, _ => None, }