anmonteiro / httpun-ws

Other
27 stars 14 forks source link

Wsd.close without a close code does not send a close frame #37

Open aantron opened 3 years ago

aantron commented 3 years ago

In

https://github.com/anmonteiro/websocketaf/blob/248a2cb0dcffa51996c3ad7643577dce75d67454/lib/wsd.ml#L62-L72

Wsd.close ~code:1000 sends a close frame with status 1000, but Wsd.close without ~code appears to just hard-close the WebSocket connection. This might not be unreasonable, but IMO it should be documented, because another reasonable interpretation is that omitting ~code should cause a default code to be sent.