diff --git a/Libraries/LibWebSocket/WebSocket.h b/Libraries/LibWebSocket/WebSocket.h index cb3b72054ad..7229a12802a 100644 --- a/Libraries/LibWebSocket/WebSocket.h +++ b/Libraries/LibWebSocket/WebSocket.h @@ -28,6 +28,7 @@ enum class CloseStatusCode : u16 { GoingAway = 1001, ProtocolError = 1002, UnsupportedData = 1003, + NoStatusReceived = 1005, AbnormalClosure = 1006, InvalidPayload = 1007, PolicyViolation = 1008, @@ -55,7 +56,7 @@ public: void send(Message const&); // This can only be used if the `ready_state` is `ReadyState::Open` - void close(u16 code = 1005, ByteString const& reason = {}); + void close(u16 code = to_underlying(CloseStatusCode::NoStatusReceived), ByteString const& reason = {}); Function on_open; Function on_close; @@ -127,7 +128,7 @@ private: bool m_discard_connection_requested { false }; - u16 m_last_close_code { 1005 }; + u16 m_last_close_code { to_underlying(CloseStatusCode::NoStatusReceived) }; ByteString m_last_close_message; ConnectionInfo m_connection;