From 9c76260756865011331342146410c8feb6b53b4c Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Fri, 13 Dec 2024 16:55:57 -0800 Subject: [PATCH] LibWeb: Sync statusText check with spec update Synced change from https://github.com/whatwg/fetch/pull/1795. No functional changes; only update comments to reflect the latest spec. --- Libraries/LibWeb/Fetch/Response.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/Fetch/Response.cpp b/Libraries/LibWeb/Fetch/Response.cpp index 6d3c13362126..6eac1a90e280 100644 --- a/Libraries/LibWeb/Fetch/Response.cpp +++ b/Libraries/LibWeb/Fetch/Response.cpp @@ -87,7 +87,7 @@ GC::Ref Response::create(JS::Realm& realm, GC::Ref Response::initialize_response(ResponseInit const& init if (init.status < 200 || init.status > 599) return WebIDL::SimpleException { WebIDL::SimpleExceptionType::RangeError, "Status must be in range 200-599"sv }; - // 2. If init["statusText"] does not match the reason-phrase token production, then throw a TypeError. + // 2. If init["statusText"] is not the empty string and does not match the reason-phrase token production, then throw a TypeError. if (!is_valid_status_text(init.status_text)) return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, "Invalid statusText: does not match the reason-phrase token production"sv };