Skip to content

Commit dfbb6cf

Browse files
committed
use base64easy instead of base64
1 parent 6e5ea04 commit dfbb6cf

File tree

4 files changed

+4
-46
lines changed

4 files changed

+4
-46
lines changed

Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ acl = [
2929
"tokio",
3030
"log",
3131
]
32-
base64 = ["dep:base64"]
3332
sockshub = [
34-
"base64",
33+
"base64easy",
3534
"socks5-impl",
3635
"tokio",
3736
"ctrlc2",
@@ -54,7 +53,7 @@ sockshub = [
5453

5554
[dependencies]
5655
as-any = { version = "0.3", optional = true }
57-
base64 = { version = "0.22", optional = true }
56+
base64easy = { version = "0.1", optional = true }
5857
bytes = { version = "1.6", optional = true }
5958
cfg-if = "1.0"
6059
chrono = { version = "0.4", optional = true }

src/base64_wrapper.rs

-34
This file was deleted.

src/http2socks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{base64_decode, std_io_error_other, Base64Engine, BoxError, Config, Credentials, TokioIo, CONNECT_TIMEOUT};
1+
use crate::{std_io_error_other, BoxError, Config, Credentials, TokioIo, CONNECT_TIMEOUT};
22
use bytes::Bytes;
33
use http_body_util::{combinators::BoxBody, BodyExt};
44
use hyper::{
@@ -223,6 +223,6 @@ fn verify_basic_authorization(credentials: &Credentials, header_value: Option<&H
223223
header_value
224224
.and_then(|v| v.to_str().ok())
225225
.and_then(|s| s.strip_prefix("Basic "))
226-
.and_then(|v| base64_decode(v, Base64Engine::Standard).ok())
226+
.and_then(|v| base64easy::decode(v, base64easy::EngineKind::Standard).ok())
227227
.map_or(false, |v| v == credentials.to_vec())
228228
}

src/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cfg_if::cfg_if! {
2-
if #[cfg(feature = "base64")] {
3-
mod base64_wrapper;
4-
pub use base64_wrapper::{base64_decode, base64_encode, Base64Engine};
5-
}
6-
}
7-
81
cfg_if::cfg_if! {
92
if #[cfg(feature = "acl")] {
103
mod acl;

0 commit comments

Comments
 (0)