mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-10 21:53:57 +00:00
Fixes fetchWsUrl
This commit is contained in:
parent
a523c82f5f
commit
f551c31010
1 changed files with 8 additions and 2 deletions
8
src/static/scripts/admin_diagnostics.js
vendored
8
src/static/scripts/admin_diagnostics.js
vendored
|
@ -349,7 +349,13 @@ async function checkHttpResponse() {
|
|||
async function fetchWsUrl(wsUrl) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
const ws = new WebSocket(wsUrl);
|
||||
const url = new URL(wsUrl);
|
||||
if (url.protocol == 'http:') {
|
||||
url.protocol = 'ws:';
|
||||
} else if (url.protocol == 'https:') {
|
||||
url.protocol = 'wss:';
|
||||
}
|
||||
const ws = new WebSocket(url.href);
|
||||
ws.onopen = () => {
|
||||
ws.close();
|
||||
resolve(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue