fix: encode controller secret, close #601

This commit is contained in:
GyDi 2023-06-08 13:48:58 +08:00 committed by GitHub
parent 6e391df5ee
commit f9a68e8b23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ const LayoutTraffic = () => {
if (!clashInfo) return;
const { server = "", secret = "" } = clashInfo;
connect(`ws://${server}/traffic?token=${secret}`);
connect(`ws://${server}/traffic?token=${encodeURIComponent(secret)}`);
return () => {
disconnect();

View File

@ -30,7 +30,7 @@ export const useLogSetup = () => {
getClashLogs().then(setLogData);
const { server = "", secret = "" } = clashInfo;
connect(`ws://${server}/logs?token=${secret}`);
connect(`ws://${server}/logs?token=${encodeURIComponent(secret)}`);
return () => {
disconnect();