]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tools: rename extract_auth_cookie to extract_cookie
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Sep 2020 12:30:44 +0000 (14:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 8 Sep 2020 06:54:33 +0000 (08:54 +0200)
It does nothing specific to authentication..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/server/rest.rs
src/tools.rs

index 5ee788d2e68f4308f7d580c84e41bf79ea2b1aa3..70c8b2c1f8ab6c33d16d4079d3c2b692e67b70e2 100644 (file)
@@ -446,7 +446,7 @@ fn extract_auth_data(headers: &http::HeaderMap) -> (Option<String>, Option<Strin
     let mut ticket = None;
     if let Some(raw_cookie) = headers.get("COOKIE") {
         if let Ok(cookie) = raw_cookie.to_str() {
-            ticket = tools::extract_auth_cookie(cookie, "PBSAuthCookie");
+            ticket = tools::extract_cookie(cookie, "PBSAuthCookie");
         }
     }
 
index 1b9d35a818cebf8986b12ec171ce0890c9edb57f..a3fbe007bbc6b43f5c265156436e9a3da5256611 100644 (file)
@@ -326,9 +326,9 @@ pub fn assert_if_modified(digest1: &str, digest2: &str) -> Result<(), Error> {
     Ok(())
 }
 
-/// Extract authentication cookie from cookie header.
+/// Extract a specific cookie from cookie header.
 /// We assume cookie_name is already url encoded.
-pub fn extract_auth_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
+pub fn extract_cookie(cookie: &str, cookie_name: &str) -> Option<String> {
     for pair in cookie.split(';') {
         let (name, value) = match pair.find('=') {
             Some(i) => (pair[..i].trim(), pair[(i + 1)..].trim()),