From de4d48aabc3239cdb352d21f94e4a1227aced17e Mon Sep 17 00:00:00 2001 From: Noam Rosenthal Date: Fri, 26 Apr 2024 15:11:02 +0100 Subject: [PATCH] Include url+headers in the quota --- fetch.bs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/fetch.bs b/fetch.bs index 42ff3f44..cc6f6baf 100644 --- a/fetch.bs +++ b/fetch.bs @@ -6711,8 +6711,6 @@ i.e., when a fetch group is terminated, or after
  • If request's client is not a fully active {{Document}}, then throw an "{{InvalidStateError}}" {{DOMException}}. -

  • Let document be request's client. -

  • If request's URL's scheme is not an HTTP(S) scheme, then throw a {{TypeError}}. @@ -6723,6 +6721,14 @@ i.e., when a fetch group is terminated, or after is eligible for deferred fetching is false, then throw a "{{NotAllowedError}}" {{DOMException}}. +

  • Let totalRequestLength be the [=string/length=] of request's + URL, serialized with + [=URL serializer/exclude fragment=] set to true. + +

  • For each (name, value) in + header list, increment totalRequestLength by name's + [=byte sequence/length=] + value's [=byte sequence/length=]. +

  • If request's body is non-null then: @@ -6736,13 +6742,14 @@ i.e., when a fetch group is terminated, or after

    This disallows sending deferred fetches with a live {{ReadableStream}}. -

  • If the - available deferred fetching quota given document and request's - URL's origin is less than request's - body's length, then throw a "{{QuotaExceededError}}" - {{DOMException}}. +

  • Increment totalRequestLength by request's + body's length. +

  • If the available deferred fetching quota given request's + client and request's URL's origin + is less than totalRequestLength, then throw a "{{QuotaExceededError}}" {{DOMException}}. +

  • Set request's service-workers mode to "none".

  • Set request's keepalive to true.