From 8303a558f1a4cc3e8d589d15678e8953c75362f4 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Sun, 27 Jul 2025 09:21:39 -0400 Subject: [PATCH] LibWeb: Fix acceptable WebSocket close code range --- Libraries/LibWeb/WebSockets/WebSocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Libraries/LibWeb/WebSockets/WebSocket.cpp index fdf47e73e46..0d22a31703c 100644 --- a/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -275,7 +275,7 @@ WebIDL::ExceptionOr WebSocket::protocol() const WebIDL::ExceptionOr WebSocket::close(Optional code, Optional reason) { // 1. If code is present, but is neither an integer equal to 1000 nor an integer in the range 3000 to 4999, inclusive, throw an "InvalidAccessError" DOMException. - if (code.has_value() && *code != 1000 && (*code < 3000 || *code > 4099)) + if (code.has_value() && *code != 1000 && (*code < 3000 || *code > 4999)) return WebIDL::InvalidAccessError::create(realm(), "The close error code is invalid"_string); // 2. If reason is present, then run these substeps: if (reason.has_value()) {