From: Thomas Lamprecht Date: Fri, 30 Oct 2020 12:33:36 +0000 (+0100) Subject: server/rest: user constants for HTTP headers X-Git-Tag: v0.9.5~82 X-Git-Url: https://git.proxmox.com/?p=proxmox-backup.git;a=commitdiff_plain;h=6d8a1ac9e46f68bbb19524eeb489be996e506927 server/rest: user constants for HTTP headers Signed-off-by: Thomas Lamprecht --- diff --git a/src/server/rest.rs b/src/server/rest.rs index 85ad3746..8ee3e77b 100644 --- a/src/server/rest.rs +++ b/src/server/rest.rs @@ -553,7 +553,7 @@ enum AuthData { } fn extract_auth_data(headers: &http::HeaderMap) -> Option { - if let Some(raw_cookie) = headers.get("COOKIE") { + if let Some(raw_cookie) = headers.get(header::COOKIE) { if let Ok(cookie) = raw_cookie.to_str() { if let Some(ticket) = tools::extract_cookie(cookie, "PBSAuthCookie") { let csrf_token = match headers.get("CSRFPreventionToken").map(|v| v.to_str()) { @@ -568,7 +568,7 @@ fn extract_auth_data(headers: &http::HeaderMap) -> Option { } } - match headers.get("AUTHORIZATION").map(|v| v.to_str()) { + 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())) },