Skip to content

Commit 9955f94

Browse files
committed
Fix authenticate ws before connection bug
1 parent ef25b4d commit 9955f94

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
@@ -411,7 +411,7 @@ export class Store {
411411
if (agent) {
412412
setCookieAuthentication(this, agent);
413413
this.webSockets.forEach(ws => {
414-
authenticate(ws, this);
414+
ws.readyState === ws.OPEN && authenticate(ws, this);
415415
});
416416
this.resources.forEach(r => {
417417
if (r.isUnauthorized()) {
@@ -425,7 +425,7 @@ export class Store {
425425
public setServerUrl(url: string): void {
426426
tryValidURL(url);
427427

428-
if (url.substr(-1) === '/') {
428+
if (url.substring(-1) === '/') {
429429
throw Error('baseUrl should not have a trailing slash');
430430
}
431431

0 commit comments

Comments
 (0)