Skip to content

Commit 77b5efb

Browse files
committed
Clean up use of privileged headers
1 parent 7f0a0eb commit 77b5efb

1 file changed

Lines changed: 14 additions & 35 deletions

File tree

fetch.bs

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,17 @@ efficient representation, as long as they also support an associated data struct
622622
<dfn export for="header list" id=concept-header-list-hidden-range-value>hidden range value</dfn>
623623
(null or a <a for=/>header value</a>). It is initially null.
624624

625-
<p class=note>This is for cases where a "<code>no-cors</code>" <a for=/>request</a> needs to include a
626-
`<code>Range</code>` header, but it can not be exposed via {{Headers}}. See <a for=request>add a range
627-
header</a>.
625+
<div class=note>
626+
<p>This is for cases where a "<code>no-cors</code>" <a for=/>request</a> needs to include a
627+
`<code>Range</code>` header, but it can not be exposed via {{Headers}}. It can be set by privileged
628+
APIs, and will be preserved if its associated request object is copied, but will be removed if the
629+
request is modified by unprivileged APIs.
630+
631+
<p>`<code>Range</code>` headers are commonly used by <a lt="download the hyperlink">downloads</a>
632+
and <a lt="resource fetch algorithm">media fetches</a>.
633+
634+
<p>A helper is provided to <a for=request>add a range header</a> to a particular request.
635+
</div>
628636

629637
<div algorithm>
630638
<p>To <dfn export for="header list" id=concept-header-list-get-range-value>get the range value</dfn>
@@ -1161,23 +1169,6 @@ following is true:
11611169
<p>A <dfn export>CORS non-wildcard request-header name</dfn> is a <a for=/>header name</a> that is a
11621170
<a>byte-case-insensitive</a> match for `<code>Authorization</code>`.
11631171

1164-
<p>A <dfn export>privileged no-CORS request-header name</dfn> is a <a for=/>header name</a> that is
1165-
a <a>byte-case-insensitive</a> match for one of
1166-
1167-
<ul class=brief>
1168-
<li>`<code>Range</code>`.
1169-
</ul>
1170-
1171-
<div class=note>
1172-
<p>These are headers that can be set by privileged APIs, and will be preserved if their associated
1173-
request object is copied, but will be removed if the request is modified by unprivileged APIs.
1174-
1175-
<p>`<code>Range</code>` headers are commonly used by <a lt="download the hyperlink">downloads</a>
1176-
and <a lt="resource fetch algorithm">media fetches</a>.
1177-
1178-
<p>A helper is provided to <a for=request>add a range header</a> to a particular request.
1179-
</div>
1180-
11811172
<p>A <dfn export>CORS-safelisted response-header name</dfn>, given a <a for=/>list</a> of
11821173
<a for=/>header names</a> <var>list</var>, is a <a for=/>header name</a> that is a
11831174
<a>byte-case-insensitive</a> match for one of
@@ -8015,20 +8006,8 @@ value (for {{Headers/delete()}}) that always succeeds in <a>CORS-safelisted requ
80158006
<div algorithm>
80168007
<p>To
80178008
<dfn for=Headers id=concept-headers-remove-privileged-no-cors-request-headers>remove privileged no-CORS request-headers</dfn>
8018-
from a {{Headers}} object (<var>headers</var>), run these steps:
8019-
8020-
<ol>
8021-
<li><p><a for="list">For each</a> <var>headerName</var> of
8022-
<a>privileged no-CORS request-header names</a>:
8023-
8024-
<ol>
8025-
<li><p><a for="header list">Delete</a> <var>headerName</var> from <var>headers</var>'s
8026-
<a for=Headers>header list</a>.
8027-
</ol>
8028-
8029-
<li><p>Set <var>headers</var>'s <a for=Headers>header list</a>'s
8030-
<a for="header list">hidden range value</a> to null.
8031-
</ol>
8009+
from a {{Headers}} object (<var>headers</var>), set <var>headers</var>'s
8010+
<a for=Headers>header list</a>'s <a for="header list">hidden range value</a> to null.
80328011

80338012
<p class=note>This is called when headers are modified by unprivileged code.
80348013
</div>
@@ -8074,7 +8053,7 @@ method steps are to <a for=Headers>append</a> (<var>name</var>, <var>value</var>
80748053

80758054
<li><p>If <a>this</a>'s <a for=Headers>guard</a> is "<code>request-no-cors</code>", <var>name</var>
80768055
is not a <a>no-CORS-safelisted request-header name</a>, and <var>name</var> is not a
8077-
<a>privileged no-CORS request-header name</a>, then return.
8056+
<a>byte-case-insensitive</a> match for `<code>Range</code>`, then return.
80788057

80798058
<li><p>If <a>this</a>'s <a for=Headers>header list</a> <a for="header list">does not contain</a>
80808059
<var>name</var>, then return.

0 commit comments

Comments
 (0)