From 31c2f5974c51d8514db431eb83a61336ce800ff4 Mon Sep 17 00:00:00 2001 From: Demur Rumed Date: Sat, 13 Jan 2024 16:12:06 +0000 Subject: [PATCH 1/2] base64 0.21 --- Cargo.toml | 2 +- src/input/basic_http_auth.rs | 4 ++-- src/websocket/mod.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab950e7d5..48adefa11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ ssl = ["tiny_http/ssl"] rustls = ["tiny_http/ssl-rustls"] [dependencies] -base64 = "0.13" +base64 = "0.21" brotli = { version = "3.3.2", optional = true } chrono = { version = "0.4.19", default-features = false, features = ["clock"] } filetime = "0.2.0" diff --git a/src/input/basic_http_auth.rs b/src/input/basic_http_auth.rs index 4244ef22d..461b35663 100644 --- a/src/input/basic_http_auth.rs +++ b/src/input/basic_http_auth.rs @@ -17,7 +17,7 @@ //! - In order to read a plain text body, see //! [the `plain_text_body` function](fn.plain_text_body.html). -use base64; +use base64::{Engine as _, prelude::BASE64_STANDARD}; use Request; /// Credentials returned by `basic_http_auth`. @@ -73,7 +73,7 @@ pub fn basic_http_auth(request: &Request) -> Option { return None; } - let authvalue = match split.next().and_then(|val| base64::decode(val).ok()) { + let authvalue = match split.next().and_then(|val| BASE64_STANDARD.decode(val).ok()) { Some(v) => v, None => return None, }; diff --git a/src/websocket/mod.rs b/src/websocket/mod.rs index e89f95892..32d7e6da1 100644 --- a/src/websocket/mod.rs +++ b/src/websocket/mod.rs @@ -69,7 +69,7 @@ pub use self::websocket::Message; pub use self::websocket::SendError; pub use self::websocket::Websocket; -use base64; +use base64::{Engine as _, prelude::BASE64_STANDARD}; use sha1_smol::Sha1; use std::borrow::Cow; use std::error; @@ -246,5 +246,5 @@ fn convert_key(input: &str) -> String { sha1.update(input.as_bytes()); sha1.update(b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); - base64::encode_config(&sha1.digest().bytes(), base64::STANDARD) + BASE64_STANDARD.encode(&sha1.digest().bytes()) } From 82474071ec713825bb7c62c73d531c3d2afb0835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Fri, 7 Jun 2024 06:18:48 +0000 Subject: [PATCH 2/2] base64 0.22 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 48adefa11..bd6103d7a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ ssl = ["tiny_http/ssl"] rustls = ["tiny_http/ssl-rustls"] [dependencies] -base64 = "0.21" +base64 = "0.22" brotli = { version = "3.3.2", optional = true } chrono = { version = "0.4.19", default-features = false, features = ["clock"] } filetime = "0.2.0"