mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/Fetch: Add a constant for the keepalive maximum size
This commit is contained in:
parent
c5b8e75204
commit
35047de1d8
Notes:
github-actions[bot]
2024-08-11 19:08:15 +00:00
Author: https://github.com/jamierocks
Commit: 35047de1d8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1025
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 5 additions and 1 deletions
|
@ -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.
|
// 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));
|
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
|
// NOTE: The above limit ensures that requests that are allowed to outlive the environment settings object
|
||||||
|
|
|
@ -18,6 +18,10 @@ namespace Web::Fetch::Fetching {
|
||||||
// The document `Accept` header value is `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`.
|
// The document `Accept` header value is `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`.
|
||||||
constexpr auto document_accept_header_value = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"sv;
|
constexpr auto document_accept_header_value = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"sv;
|
||||||
|
|
||||||
|
// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch
|
||||||
|
// If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.
|
||||||
|
constexpr auto keepalive_maximum_size = 64 * KiB;
|
||||||
|
|
||||||
#define ENUMERATE_BOOL_PARAMS \
|
#define ENUMERATE_BOOL_PARAMS \
|
||||||
__ENUMERATE_BOOL_PARAM(IncludeCredentials) \
|
__ENUMERATE_BOOL_PARAM(IncludeCredentials) \
|
||||||
__ENUMERATE_BOOL_PARAM(IsAuthenticationFetch) \
|
__ENUMERATE_BOOL_PARAM(IsAuthenticationFetch) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue