1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-26 00:59:24 -05:00
denoland-deno/ext/websocket
Charlie Bellini 8f7787f81b
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-22 00:04:47 +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-22 00:04:47 +01:00
02_websocketstream.js fix(ext/websocket): unhandled close rejection in WebsocketStream (#25125) 2024-08-21 23:00:23 +02:00
Cargo.toml chore: forward v2.1.1 release commit to main (#26981) 2024-11-21 14:35:32 -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