LibWeb/Fetch: Add a constant for the keepalive maximum size

This commit is contained in:
Jamie Mansfield 2024-08-11 12:42:53 +01:00 committed by Tim Ledbetter
commit 35047de1d8
Notes: github-actions[bot] 2024-08-11 19:08:15 +00:00
2 changed files with 5 additions and 1 deletions

View file

@ -1670,7 +1670,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
}
// 5. If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.
if ((content_length.value() + inflight_keep_alive_bytes) > 65536)
if ((content_length.value() + inflight_keep_alive_bytes) > keepalive_maximum_size)
return PendingResponse::create(vm, request, Infrastructure::Response::network_error(vm, "Keepalive request exceeded maximum allowed size of 64 KiB"sv));
// NOTE: The above limit ensures that requests that are allowed to outlive the environment settings object