diff --git a/Cargo.toml b/Cargo.toml index ab950e7d5..bd6103d7a 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.22" 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()) }