LibWeb: Don't close websocket if already closed in make_disappear() AO

This commit is contained in:
Tim Ledbetter 2025-02-26 18:30:19 +00:00 committed by Andreas Kling
parent d8bf8a3bb9
commit 6fc19ec059
Notes: github-actions[bot] 2025-02-26 19:21:16 +00:00

View file

@ -411,6 +411,10 @@ void WebSocket::make_disappear()
// -> Otherwise
// - Do nothing.
// NOTE: All of these are handled by the WebSocket Protocol when calling close()
auto ready_state = this->ready_state();
if (ready_state == Requests::WebSocket::ReadyState::Closing || ready_state == Requests::WebSocket::ReadyState::Closed)
return;
m_websocket->close(1001);
}