mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-05-14 05:52:48 +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
|
@ -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
Add a link
Reference in a new issue