mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-14 13:32:23 +00:00
LibWeb: Use keepalive maximum size in NavigatorBeacon
This is defined as 64 KiB in the fetch spec. See: - https://wpt.live/beacon/beacon-basic.https.window.html
This commit is contained in:
parent
35047de1d8
commit
17c1e99ce4
Notes:
github-actions[bot]
2024-08-11 19:08:09 +00:00
Author: https://github.com/jamierocks
Commit: 17c1e99ce4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1025
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <LibWeb/DOM/Document.h>
|
#include <LibWeb/DOM/Document.h>
|
||||||
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
#include <LibWeb/Fetch/Fetching/Fetching.h>
|
||||||
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
|
||||||
|
#include <LibWeb/Fetch/Infrastructure/HTTP/Bodies.h>
|
||||||
#include <LibWeb/HTML/Navigator.h>
|
#include <LibWeb/HTML/Navigator.h>
|
||||||
#include <LibWeb/HTML/NavigatorBeacon.h>
|
#include <LibWeb/HTML/NavigatorBeacon.h>
|
||||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||||
|
@ -50,7 +51,8 @@ WebIDL::ExceptionOr<bool> NavigatorBeaconMixin::send_beacon(String const& url, O
|
||||||
auto& content_type = body_with_type.type;
|
auto& content_type = body_with_type.type;
|
||||||
|
|
||||||
// 6.2 If the amount of data that can be queued to be sent by keepalive enabled requests is exceeded by the size of transmittedData (as defined in HTTP-network-or-cache fetch), set the return value to false and terminate these steps.
|
// 6.2 If the amount of data that can be queued to be sent by keepalive enabled requests is exceeded by the size of transmittedData (as defined in HTTP-network-or-cache fetch), set the return value to false and terminate these steps.
|
||||||
// FIXME: We don't have a size limit in Fetching::fetch
|
if (transmitted_data->length().has_value() && transmitted_data->length().value() > Fetch::Fetching::keepalive_maximum_size)
|
||||||
|
return false;
|
||||||
|
|
||||||
// 6.3 If contentType is not null:
|
// 6.3 If contentType is not null:
|
||||||
if (content_type.has_value()) {
|
if (content_type.has_value()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue