1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-11 18:17:48 -05:00
denoland-deno/ext
Charlie Bellini 7499525ed0
fix(ext/websocket): don't throw exception when sending to closed socket (#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.
2024-11-28 15:47:21 +01:00
..
broadcast_channel 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
cache 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
canvas 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
console 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
cron 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
crypto 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
fetch 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
ffi 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
fs 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
http 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
io 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
kv 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
napi 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
net 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
node 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
tls 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
url 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
web 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
webgpu 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
webidl 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
websocket fix(ext/websocket): don't throw exception when sending to closed socket (#26932) 2024-11-28 15:47:21 +01:00
webstorage 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00