Upgrade deps

This commit is contained in:
Martin Algesten
2023-01-30 23:39:55 +01:00
parent 34b239b388
commit abda74c4d8
3 changed files with 6 additions and 3 deletions

View File

@@ -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"

View File

@@ -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<S: AsRef<str>>(&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()

View File

@@ -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)));
}