Skip to content

Commit

Permalink
Use status code 1000 on WebSocket hangup for compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 13, 2020
1 parent 6039464 commit 588f64c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/providers/src.ts/websocket-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ export class WebSocketProvider extends JsonRpcProvider {
}));
}

// Hangup (navigating away from the page that opened the connection)
this._websocket.close(1001);
// Hangup
// See: https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes
this._websocket.close(1000);
}
}

0 comments on commit 588f64c

Please sign in to comment.