mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 10:14:35 +00:00
feat: core config server use last path segment as user name (#1931)
This commit is contained in:
@@ -130,10 +130,12 @@ pub async fn run_web_client(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let mut c_url = config_server_url.clone();
|
let mut c_url = config_server_url.clone();
|
||||||
c_url.set_path("");
|
if !matches!(c_url.scheme(), "ws" | "wss") {
|
||||||
|
c_url.set_path("");
|
||||||
|
}
|
||||||
let token = config_server_url
|
let token = config_server_url
|
||||||
.path_segments()
|
.path_segments()
|
||||||
.and_then(|mut x| x.next())
|
.and_then(|mut x| x.next_back())
|
||||||
.map(|x| percent_encoding::percent_decode_str(x).decode_utf8())
|
.map(|x| percent_encoding::percent_decode_str(x).decode_utf8())
|
||||||
.transpose()
|
.transpose()
|
||||||
.with_context(|| "failed to decode config server token")?
|
.with_context(|| "failed to decode config server token")?
|
||||||
|
|||||||
Reference in New Issue
Block a user