From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH backup 1/2] tools: rename extract_auth_cookie to extract_cookie
Date: Mon, 7 Sep 2020 14:56:41 +0200 [thread overview]
Message-ID: <20200907125642.30604-2-t.lamprecht@proxmox.com> (raw)
In-Reply-To: <20200907125642.30604-1-t.lamprecht@proxmox.com>
It does nothing specific to authentication..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
will be re-used for parsing the PBSLangCookie, it felt wrong having "auth" in
the name.
src/server/rest.rs | 2 +-
src/tools.rs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/server/rest.rs b/src/server/rest.rs
index 5ee788d2..70c8b2c1 100644
--- a/src/server/rest.rs
+++ b/src/server/rest.rs
@@ -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");
}
}
diff --git a/src/tools.rs b/src/tools.rs
index 1b9d35a8..a3fbe007 100644
--- a/src/tools.rs
+++ b/src/tools.rs
@@ -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()),
--
2.27.0
next prev parent reply other threads:[~2020-09-07 12:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 12:56 [pbs-devel] [PATCH backup 0/2] implement GUI translation support Thomas Lamprecht
2020-09-07 12:56 ` Thomas Lamprecht [this message]
2020-09-07 12:56 ` [pbs-devel] [PATCH backup 2/2] ui: add " Thomas Lamprecht
2020-09-08 4:56 ` Dietmar Maurer
2020-09-08 6:44 ` Thomas Lamprecht
2020-09-08 7:03 ` [pbs-devel] applied-series: [PATCH backup 0/2] implement GUI " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200907125642.30604-2-t.lamprecht@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.