mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-14 07:33:56 +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) {
|
async function fetchWsUrl(wsUrl) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
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.onopen = () => {
|
||||||
ws.close();
|
ws.close();
|
||||||
resolve(true);
|
resolve(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue