Re: [whatwg/fetch] Add special handling of `set-cookie` to Headers (PR #1346)

@annevk commented on this pull request.

Thanks, this looks good. I like the improved note and its placement. Remaining nits are all editorial.

Given the ranges of agreement expressed above I suggest we merge this February 8 and see how it goes.

> @@ -891,12 +894,31 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
   <p><a for=list>For each</a> <var>name</var> of <var>names</var>:
 
   <ol>
-   <li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var>
-   from <var>list</var>.
+   <li><p>If <var>name</var> is `<code>set-cookie</code>`, then:

`<p>` here needs to be on an indented newline as the `<li>` has multiple children. This also happens below.

> +     <li><p>Let <var>values</var> be a list of all <a lt=value for=header>values</a> of
+     <a for=/>headers</a> in <var>list</var> whose <a for=header>name</a> is a
+     <a>byte-case-insensitive</a> match for <var>name</var>, in order.
+
+     <li>
+      <p><a for=list>For each</a> <var>value</var> of <var>values</var>:
+
+      <ol>
+       <li><p><a for=list>Append</a> (<var>name</var>, <var>value</var>) to <var>headers</var>.
+      </ol>
+    </ol>
+
+   <li><p>Otherwise:
+
+    <ol>
+      <li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var>

Indentation here is by more than a single space.

> @@ -6722,6 +6740,19 @@ method steps are to <a for=Headers>append</a> (<var>name</var>, <var>value</var>
 </ol>
 </div>
 
+<div algorithm>
+<p>The <dfn export for=Headers method><code>getSetCookie()</code></dfn> method steps are:
+
+<ol>
+ <li><p>If <a>this</a>'s <a for=Headers>header list</a> <a for="header list">does not contain</a> `<code>Set-Cookie</code>`, then
+ return an empty list.

Use « » here? We also do that elsewhere already.

> @@ -6160,6 +6188,17 @@ method steps are to <a for=Headers>append</a> (<var>name</var>, <var>value</var>
  <a for=Headers>header list</a>.
 </ol>
 
+<p>The <dfn export for=Headers method><code>getSetCookie()</code></dfn> method steps are:
+
+<ol>
+ <li><p>If <a>this</a>'s <a for=Headers>header list</a> <a for="header list">does not contain</a> `<code>Set-Cookie</code>`, then

This is beyond 100 columns.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/1346#pullrequestreview-1285359798

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/pull/1346/review/1285359798@github.com>

Received on Monday, 6 February 2023 15:02:30 UTC