Skip to content

Commit 50d77e6

Browse files
lucacasonatoannevk
andauthored
Add Set-Cookie as a forbidden header name
Tests: web-platform-tests/wpt#34424. Co-authored-by: Anne van Kesteren <[email protected]>
1 parent 90a4d32 commit 50d77e6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

fetch.bs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,7 @@ is a <a>byte-case-insensitive</a> match for one of
10151015
<li>`<code>Keep-Alive</code>`
10161016
<li>`<a http-header><code>Origin</code></a>`
10171017
<li>`<code>Referer</code>`
1018+
<li>`<code>Set-Cookie</code>`
10181019
<li>`<code>TE</code>`
10191020
<li>`<code>Trailer</code>`
10201021
<li>`<code>Transfer-Encoding</code>`
@@ -1025,10 +1026,18 @@ is a <a>byte-case-insensitive</a> match for one of
10251026
<p>or a <a for=/>header name</a> that when <a>byte-lowercased</a>
10261027
<a for="byte sequence">starts with</a> `<code>proxy-</code>` or `<code>sec-</code>`.
10271028

1028-
<p class=note>These are forbidden so the user agent remains in full control over them.
1029-
<a for=/>Header names</a> starting with `<code>Sec-</code>` are reserved to allow new
1030-
<a for=/>headers</a> to be minted that are safe from APIs using <a for=/>fetch</a> that allow
1031-
control over <a for=/>headers</a> by developers, such as {{XMLHttpRequest}}. [[XHR]]
1029+
<div class=note>
1030+
<p>These are forbidden so the user agent remains in full control over them.
1031+
1032+
<p><a for=/>Header names</a> starting with `<code>Sec-</code>` are reserved to allow new
1033+
<a for=/>headers</a> to be minted that are safe from APIs using <a for=/>fetch</a> that allow
1034+
control over <a for=/>headers</a> by developers, such as {{XMLHttpRequest}}. [[XHR]]
1035+
1036+
<p>The `<code>Set-Cookie</code>` header is semantically a response header, so it is not useful on
1037+
requests. Because `<code>Set-Cookie</code>` headers cannot be combined, they require more complex
1038+
handling in the {{Headers}} object. It is forbidden here to avoid leaking this complexity into
1039+
requests.
1040+
</div>
10321041

10331042
<p>A <dfn export>forbidden response-header name</dfn> is a <a for=/>header name</a> that is a
10341043
<a>byte-case-insensitive</a> match for one of:

0 commit comments

Comments
 (0)