diff --git a/fetch.bs b/fetch.bs
index a845d5ab9..bbabc5083 100644
--- a/fetch.bs
+++ b/fetch.bs
@@ -1196,6 +1196,58 @@ downloads. This format of range header value can be set using add a range hea
implementation-defined header value for the `User-Agent
`
header.
+
To +filter include a +header list list and a list of names includeNames, run these steps: + +
Let filteredList be an empty header list. + +
For each (name, value) in list: + +
If name is in includeNames, then append (name, value) to filteredList. +
Return filteredList. +
To +filter exclude a +header list list and a list of names excludeNames, run these steps: + +
Let filteredList be an empty header list. + +
For each (name, value) in list: + +
If name not in excludeNames then append (name, value) to filteredList. +
Return filteredList. +
To +get the size of a +header list list, run these steps: + +
Let sizeInBytes be `0`. + +
For each (name, value) in list: + +
+ +Return sizeInBytes. +
Return allowed. +
Authorization
` or `Cookie
`) by adding headers
+to cross-origin requests until the total size of all HTTP request headers exceeds the server side limit. If this
+algorithm returns true, the CORS-preflight request must be run. In order for this approach to succeed, servers should
+not set an HTTP request headers size limit below 8 kibibyte.
+
+Run these steps to check if the header size is over the cross-origin limits on the provided request: + +
If request's origin is same origin with request's + current URL's origin, return `false`. + +
Let sensitiveHeaderList be the result of running filter include on request's
+ header list with `(Authorization
, Cookie
) as includeNames`.
+
+
If the result of running get the size on sensitiveHeaderList is greater than 4 kibibyte, return `true`. + +
Let nonSensitiveHeaderList be the result of running filter exclude on request's
+ header list with `(Authorization
, Cookie
) as excludeNames`.
+
+
If the result of running get the size on nonSensitiveHeaderList is greater than 4 kibibyte, return `true`. + +
Return `false`. +
If makeCORSPreflight is true and one of these conditions is true: +
If one of these conditions is true:
There is no method cache entry match for request's - method using request, and either request's +
makeCORSPreflight is true and there is no method cache entry match for + request's method using request, and either request's method is not a CORS-safelisted method or request's use-CORS-preflight flag is set. -
makeCORSPreflight is true and there is at least one item in the + CORS-unsafe request-header names with request's header list + for which there is no header-name cache entry match using request. + +
Then: