From 6e3ebf019b9fc5cb8a4df5a47da3ddcb22804dba Mon Sep 17 00:00:00 2001 From: Thebora Kompanioni Date: Fri, 15 Apr 2022 12:18:47 +0200 Subject: [PATCH] fix: use `1000` as websocket close code (#219) Firefox throws a `DOMException` when using `1001` as close code: `A parameter or an operation is not supported by the underlying object`. Cannot really find out why this is, but in this case it does not really matter, as the code only runs if there is no connection in the first place. --- src/context/WebsocketContext.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context/WebsocketContext.jsx b/src/context/WebsocketContext.jsx index 271d9851..55ef5535 100644 --- a/src/context/WebsocketContext.jsx +++ b/src/context/WebsocketContext.jsx @@ -155,7 +155,7 @@ const WebsocketProvider = ({ children }) => { needsForceClose ) if (needsForceClose) { - websocket.close(1001, 'Force-close pending connection') + websocket.close(1000, 'Force-close pending connection') } }, WEBSOCKET_ESTABLISH_CONNECTION_MAX_DURATION)