From abda74c4d8d1235c6eddccafd3c4bd690dc10ea7 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Mon, 30 Jan 2023 23:39:55 +0100 Subject: [PATCH] Upgrade deps --- Cargo.toml | 2 +- src/proxy.rs | 4 +++- src/unit.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00dc9f0..418ae58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ gzip = ["flate2"] brotli = ["brotli-decompressor"] [dependencies] -base64 = "0.13" +base64 = "0.21" cookie = { version = "0.16", default-features = false, optional = true} once_cell = "1" url = "2" diff --git a/src/proxy.rs b/src/proxy.rs index ff94139..0148904 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -1,3 +1,5 @@ +use base64::{prelude::BASE64_STANDARD, Engine}; + use crate::error::{Error, ErrorKind}; /// Proxy protocol @@ -131,7 +133,7 @@ impl Proxy { pub(crate) fn connect>(&self, host: S, port: u16) -> String { let authorization = if self.use_authorization() { - let creds = base64::encode(format!( + let creds = BASE64_STANDARD.encode(format!( "{}:{}", self.user.clone().unwrap_or_default(), self.password.clone().unwrap_or_default() diff --git a/src/unit.rs b/src/unit.rs index 895067f..2011bb6 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -3,6 +3,7 @@ use std::io::{self, Write}; use std::ops::Range; use std::time; +use base64::{prelude::BASE64_STANDARD, Engine}; use log::debug; use url::Url; @@ -87,7 +88,7 @@ impl Unit { if (!username.is_empty() || !password.is_empty()) && get_header(&headers, "authorization").is_none() { - let encoded = base64::encode(format!("{}:{}", username, password)); + let encoded = BASE64_STANDARD.encode(format!("{}:{}", username, password)); extra.push(Header::new("Authorization", &format!("Basic {}", encoded))); }