From cd25d25b22a3a9b1fa5805e1482826e6214f797a Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Sun, 16 Jun 2024 20:18:04 +0800 Subject: [PATCH] feat(ssurl): remark support percent encoding --- crates/shadowsocks/src/config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/shadowsocks/src/config.rs b/crates/shadowsocks/src/config.rs index 405c01b0a470..4195eab98ff6 100644 --- a/crates/shadowsocks/src/config.rs +++ b/crates/shadowsocks/src/config.rs @@ -846,7 +846,10 @@ impl ServerConfig { } if let Some(frag) = parsed.fragment() { - svrconfig.set_remarks(frag); + match percent_encoding::percent_decode_str(frag).decode_utf8() { + Ok(m) => svrconfig.set_remarks(m), + Err(..) => svrconfig.set_remarks(frag), + } } Ok(svrconfig)