summaryrefslogtreecommitdiff
path: root/src/api/traffic.js
diff options
context:
space:
mode:
authorJoker_ <[email protected]>2020-07-12 23:39:03 +0800
committerJoker_ <[email protected]>2020-07-12 23:39:03 +0800
commit19dfbf7f2bc78ab4a5dba908ddb3ee64ab29b578 (patch)
tree7bec353f8228764f2c391eaa241bcbb838d4b3ad /src/api/traffic.js
parent9de394eedfb9913df5fe44b73f9e1a6da387a165 (diff)
URI-encode secret before appending to websocket URL
Diffstat (limited to 'src/api/traffic.js')
-rw-r--r--src/api/traffic.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/traffic.js b/src/api/traffic.js
index 4aa8ff6..f3f33ca 100644
--- a/src/api/traffic.js
+++ b/src/api/traffic.js
@@ -73,7 +73,7 @@ function getWsUrl(apiConfig) {
const { hostname, port, secret } = apiConfig;
let qs = '';
if (typeof secret === 'string' && secret !== '') {
- qs += '?token=' + secret;
+ qs += '?token=' + encodeURIComponent(secret);
}
return `ws://${hostname}:${port}${endpoint}${qs}`;
}