Merge pull request #508 from JokerQyou/master
This commit is contained in:
commit
80d0dff7bf
3 changed files with 9 additions and 9 deletions
|
@ -47,7 +47,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}`;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ function getWsUrl(apiConfig) {
|
|||
const { hostname, port, secret, logLevel } = apiConfig;
|
||||
let qs = '?level=' + logLevel;
|
||||
if (typeof secret === 'string' && secret !== '') {
|
||||
qs += '&token=' + secret;
|
||||
qs += '&token=' + encodeURIComponent(secret);
|
||||
}
|
||||
return `ws://${hostname}:${port}${endpoint}${qs}`;
|
||||
}
|
||||
|
@ -116,13 +116,13 @@ function fetchLogsWithFetch(apiConfig, appendLog) {
|
|||
const { url, init } = getURLAndInit(apiConfig);
|
||||
fetch(url + endpoint + '?level=' + apiConfig.logLevel, {
|
||||
...init,
|
||||
signal
|
||||
signal,
|
||||
}).then(
|
||||
response => {
|
||||
(response) => {
|
||||
const reader = response.body.getReader();
|
||||
pump(reader, appendLog);
|
||||
},
|
||||
err => {
|
||||
(err) => {
|
||||
fetched = false;
|
||||
if (signal.aborted) return;
|
||||
|
||||
|
|
|
@ -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}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue