1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-14 11:27:57 -05:00
denoland-deno/ext/websocket
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
..
autobahn build: remove --unstable flags from CI (#25548) 2024-09-10 03:10:20 +02:00
01_websocket.js fix(ext/websocket): don't throw exception when sending to closed socket (#26932) 2024-11-28 15:47:21 +01:00
02_websocketstream.js fix(ext/websocket): unhandled close rejection in WebsocketStream (#25125) 2024-08-21 23:00:23 +02:00
Cargo.toml 2.1.1 (#26978) 2024-11-21 12:28:20 -05:00
lib.deno_websocket.d.ts chore: add code generation for @types/deno (#25545) 2024-09-23 19:18:52 +00:00
lib.rs feat: permission stack traces in ops (#26938) 2024-11-20 21:24:04 +00:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
stream.rs chore: update copyright to 2024 (#21753) 2024-01-01 19:58:21 +00:00

deno_websocket

This op crate implements the websocket functions of Deno.

Spec: https://html.spec.whatwg.org/multipage/web-sockets.html