Re: [whatwg/fetch] "Get" a structured header from a header list. (#983)

mikewest commented on this pull request.

Thanks, @annevk!

> + <li><p>If <var>type</var> is not one of "<code>dictionary</code>", "<code>list</code>", or
+ "<code>item</code>", return failure.
+ <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>value</var> is null, return null.
+ <li><p>Let <var>result</var> be the result of executing the <a>parsing structured headers</a>
+ algorithm with <var ignore>input_string</var> set to <var>value</var>, and
+ <var ignore>header_type</var> set to <var>type</var>.
+ <li><p>If parsing failed, return failure.
+ <li><p>Return <var>result</var>.
+</ol>
+
+<p class=note><a>Structured header values</a> are defined as objects which HTTP can (eventually)
+serialize in interesting and efficient ways. For the moment, Fetch only supports <a for=/>header</a>
+<a for=header>values</a> as <a for=/>byte sequences</a>, which means that these objects can be set
+in <a for=/>header lists</a> only via serialization, and they can be obtained from <a for=/>header

Done.

> + <li><p>If <var>value</var> is null, return null.
+ <li><p>Let <var>result</var> be the result of executing the <a>parsing structured headers</a>
+ algorithm with <var ignore>input_string</var> set to <var>value</var>, and
+ <var ignore>header_type</var> set to <var>type</var>.
+ <li><p>If parsing failed, return failure.
+ <li><p>Return <var>result</var>.
+</ol>
+
+<p class=note><a>Structured header values</a> are defined as objects which HTTP can (eventually)
+serialize in interesting and efficient ways. For the moment, Fetch only supports <a for=/>header</a>
+<a for=header>values</a> as <a for=/>byte sequences</a>, which means that these objects can be set
+in <a for=/>header lists</a> only via serialization, and they can be obtained from <a for=/>header
+lists</a> only by parsing. In the future the fact that they are objects might be preserved
+end-to-end. [[!HEADER-STRUCTURE]]
+
+</div>

Accidental, thanks!

> @@ -584,10 +585,32 @@ pair in a <a for=/>header list</a> <var>list</var>, run these steps:
  <li><p><a for="header list">Set</a> <var>name</var>/<var>serializedValue</var> in <var>list</var>.
 </ol>
 
-<p class="note"><a>Structured header values</a> are defined as objects which HTTP can (eventually)
-serialize in interesting and efficient ways. For the moment, Fetch only supports setting these
-objects in <a for=/>header lists</a> by serializing them. In the future the fact that they are
-objects might be preserved end-to-end. [[!HEADER-STRUCTURE]]
+<p>To
+<dfn export for="header list" id=concept-header-list-get-structured-header>get a structured header</dfn>
+given a <var>name</var> and a <var>type</var> from a <a for=/>header list</a> <var>list</var>, run
+these steps:
+
+<ol>
+ <li><p>If <var>type</var> is not one of "<code>dictionary</code>", "<code>list</code>", or
+ "<code>item</code>", return failure.

Changed to an assert.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/983#pullrequestreview-332396795

Received on Monday, 16 December 2019 08:22:37 UTC