Skip to content

Commit

Permalink
use base64easy instead of base64
Browse files Browse the repository at this point in the history
  • Loading branch information
ssrlive committed Jan 3, 2025
1 parent 6e5ea04 commit dfbb6cf
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 46 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ acl = [
"tokio",
"log",
]
base64 = ["dep:base64"]
sockshub = [
"base64",
"base64easy",
"socks5-impl",
"tokio",
"ctrlc2",
Expand All @@ -54,7 +53,7 @@ sockshub = [

[dependencies]
as-any = { version = "0.3", optional = true }
base64 = { version = "0.22", optional = true }
base64easy = { version = "0.1", optional = true }
bytes = { version = "1.6", optional = true }
cfg-if = "1.0"
chrono = { version = "0.4", optional = true }
Expand Down
34 changes: 0 additions & 34 deletions src/base64_wrapper.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/http2socks.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{base64_decode, std_io_error_other, Base64Engine, BoxError, Config, Credentials, TokioIo, CONNECT_TIMEOUT};
use crate::{std_io_error_other, BoxError, Config, Credentials, TokioIo, CONNECT_TIMEOUT};
use bytes::Bytes;
use http_body_util::{combinators::BoxBody, BodyExt};
use hyper::{
Expand Down Expand Up @@ -223,6 +223,6 @@ fn verify_basic_authorization(credentials: &Credentials, header_value: Option<&H
header_value
.and_then(|v| v.to_str().ok())
.and_then(|s| s.strip_prefix("Basic "))
.and_then(|v| base64_decode(v, Base64Engine::Standard).ok())
.and_then(|v| base64easy::decode(v, base64easy::EngineKind::Standard).ok())
.map_or(false, |v| v == credentials.to_vec())
}
7 changes: 0 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
cfg_if::cfg_if! {
if #[cfg(feature = "base64")] {
mod base64_wrapper;
pub use base64_wrapper::{base64_decode, base64_encode, Base64Engine};
}
}

cfg_if::cfg_if! {
if #[cfg(feature = "acl")] {
mod acl;
Expand Down

0 comments on commit dfbb6cf

Please sign in to comment.