mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-05 14:20:21 +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"
|
httparse = "1.8"
|
||||||
ipstack = { version = "0.0" }
|
ipstack = { version = "0.0" }
|
||||||
log = { version = "0.4", features = ["std"] }
|
log = { version = "0.4", features = ["std"] }
|
||||||
|
percent-encoding = "2"
|
||||||
socks5-impl = { version = "0.5" }
|
socks5-impl = { version = "0.5" }
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tokio = { version = "1.36", features = ["full"] }
|
tokio = { version = "1.36", features = ["full"] }
|
||||||
|
@ -36,7 +37,6 @@ tun2 = { version = "1.2", features = ["async"] }
|
||||||
udp-stream = { version = "0.0", default-features = false }
|
udp-stream = { version = "0.0", default-features = false }
|
||||||
unicase = "2.7"
|
unicase = "2.7"
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
url-escape = "0.1"
|
|
||||||
|
|
||||||
[target.'cfg(target_os="linux")'.dependencies]
|
[target.'cfg(target_os="linux")'.dependencies]
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
|
|
@ -326,8 +326,9 @@ impl ArgProxy {
|
||||||
let credentials = if url.username() == "" && url.password().is_none() {
|
let credentials = if url.username() == "" && url.password().is_none() {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let username = url_escape::decode(url.username());
|
use percent_encoding::percent_decode;
|
||||||
let password = url_escape::decode(url.password().unwrap_or(""));
|
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))
|
Some(UserKey::new(username, password))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue