Url decode the path

This commit is contained in:
Keivan-sf
2025-06-25 02:01:29 +03:30
parent 0308e55478
commit 5296b6a413
3 changed files with 14 additions and 2 deletions

9
Cargo.lock generated
View File

@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "aho-corasick"
@@ -236,6 +236,12 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "urlencoding"
version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
[[package]]
name = "utf8parse"
version = "0.2.1"
@@ -251,6 +257,7 @@ dependencies = [
"regex",
"serde",
"serde_json",
"urlencoding",
]
[[package]]

View File

@@ -11,3 +11,4 @@ querystring = "1.1.0"
regex = "1.9.6"
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
urlencoding = "2"

View File

@@ -31,7 +31,11 @@ pub fn create_outbound_object(data: models::VlessData) -> Outbound {
headers: Some(HeaderSetting {
Host: Some(data.query.host),
}),
path: Some(data.query.path),
path: Some(
urlencoding::decode(data.query.path.as_str())
.unwrap()
.into_owned(),
),
acceptProxyProtocol: None,
})
} else {