diff --git a/Cargo.toml b/Cargo.toml index b49c86e7..7faec001 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ members = [ [dependencies] http = "0.2.0" headers-core = { version = "0.2", path = "./headers-core" } -base64 = "0.13" +base64 = "0.20" bitflags = "1.0" bytes = "1" mime = "0.3.14" diff --git a/src/common/authorization.rs b/src/common/authorization.rs index 734bc6e2..0292eb25 100644 --- a/src/common/authorization.rs +++ b/src/common/authorization.rs @@ -1,6 +1,5 @@ //! Authorization header and types. -use base64; use bytes::Bytes; use util::HeaderValueString; @@ -168,8 +167,10 @@ impl Credentials for Basic { } fn encode(&self) -> HeaderValue { + const ENGINE: base64::engine::fast_portable::FastPortable = base64::engine::DEFAULT_ENGINE; + let mut encoded = String::from("Basic "); - base64::encode_config_buf(&self.decoded, base64::STANDARD, &mut encoded); + base64::encode_engine_string(&self.decoded, &mut encoded, &ENGINE); let bytes = Bytes::from(encoded); HeaderValue::from_maybe_shared(bytes)