Skip to content

Commit 78e4b1c

Browse files
committed
Fix authenticate ws before connection bug
1 parent d42b023 commit 78e4b1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/store.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ export class Store {
420420
if (agent) {
421421
setCookieAuthentication(this, agent);
422422
this.webSockets.forEach(ws => {
423-
authenticate(ws, this);
423+
ws.readyState === ws.OPEN && authenticate(ws, this);
424424
});
425425
this.resources.forEach(r => {
426426
if (r.isUnauthorized()) {
@@ -434,7 +434,7 @@ export class Store {
434434
public setServerUrl(url: string): void {
435435
tryValidURL(url);
436436

437-
if (url.substr(-1) === '/') {
437+
if (url.substring(-1) === '/') {
438438
throw Error('baseUrl should not have a trailing slash');
439439
}
440440

0 commit comments

Comments
 (0)