From a91a2ca5c88403e905bf0f798393587fc4d900fa Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Mon, 8 Apr 2024 15:44:31 +0200 Subject: Closes #26. Addtional GET request for /start --- src/auth.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/auth.rs') diff --git a/src/auth.rs b/src/auth.rs index 1f4518a..74008b5 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -23,11 +23,13 @@ pub async fn auth( match auth.method { Methods::Key => { if let Some(secret) = headers.get("authorization") { - if !(auth.secret.as_str() == secret) { return Err(StatusCode::UNAUTHORIZED); }; + if auth.secret.as_str() != secret { + return Err(StatusCode::UNAUTHORIZED); + }; let response = next.run(request).await; Ok(response) } else { - return Err(StatusCode::UNAUTHORIZED); + Err(StatusCode::UNAUTHORIZED) } } Methods::None => Ok(next.run(request).await), -- cgit v1.2.3