-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ext/websocket): don't throw exception when sending to closed sock…
…et (#26932) [The WebSocket specification for the `send` function](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send) says: > The browser will throw an exception if you call `send()` when the connection is in the `CONNECTING` state. If you call `send()` when the connection is in the `CLOSING` or `CLOSED` states, the browser will silently discard the data. and: > ### Exceptions > > `InvalidStateError` [`DOMException`](https://developer.mozilla.org/en-US/docs/Web/API/DOMException) > > Thrown if [`WebSocket.readyState`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState) is `CONNECTING`. This pull request fixes the current behavior to match the specification. Also, I believe it fixes #17586.
- Loading branch information
1 parent
a19b3f4
commit 8f7787f
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters