mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-04-19 13:29:09 +00:00
use percent-encoding instead of url-escape
This commit is contained in:
parent
84c03426f2
commit
92011edd43
2 changed files with 4 additions and 3 deletions
|
@ -26,6 +26,7 @@ hashlink = "0.9"
|
|||
httparse = "1.8"
|
||||
ipstack = { version = "0.0" }
|
||||
log = { version = "0.4", features = ["std"] }
|
||||
percent-encoding = "2"
|
||||
socks5-impl = { version = "0.5" }
|
||||
thiserror = "1.0"
|
||||
tokio = { version = "1.36", features = ["full"] }
|
||||
|
@ -36,7 +37,6 @@ tun2 = { version = "1.2", features = ["async"] }
|
|||
udp-stream = { version = "0.0", default-features = false }
|
||||
unicase = "2.7"
|
||||
url = "2.5"
|
||||
url-escape = "0.1"
|
||||
|
||||
[target.'cfg(target_os="linux")'.dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
|
|
@ -326,8 +326,9 @@ impl ArgProxy {
|
|||
let credentials = if url.username() == "" && url.password().is_none() {
|
||||
None
|
||||
} else {
|
||||
let username = url_escape::decode(url.username());
|
||||
let password = url_escape::decode(url.password().unwrap_or(""));
|
||||
use percent_encoding::percent_decode;
|
||||
let username = percent_decode(url.username().as_bytes()).decode_utf8().unwrap();
|
||||
let password = percent_decode(url.password().unwrap_or("").as_bytes()).decode_utf8().unwrap();
|
||||
Some(UserKey::new(username, password))
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue