From 9cfd66dab96a1dd04a98c3b6d28c82c5a027c722 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 21 Jul 2022 11:47:47 +0800 Subject: [PATCH] feat: adjust digest auth timeout to 1day (#110) --- src/auth.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auth.rs b/src/auth.rs index 424d48e..37f1d66 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -12,6 +12,7 @@ use crate::utils::encode_uri; use crate::BoxResult; const REALM: &str = "DUFS"; +const DIGEST_AUTH_TIMEOUT: u32 = 86400; lazy_static! { static ref NONCESTARTHASH: Context = { @@ -317,8 +318,7 @@ fn validate_nonce(nonce: &[u8]) -> Result { h.consume(secs_nonce.to_be_bytes()); let h = format!("{:x}", h.compute()); if h[..26] == n[8..34] { - return Ok(dur < 300); // from the last 5min - //Authentication-Info ? + return Ok(dur < DIGEST_AUTH_TIMEOUT); } } }