Re: [whatwg/fetch] "Set" Structured Header values in header lists. (#925)

annevk commented on this pull request.

Thanks, this is what I had in mind too and hopefully simplifies the prose for, e.g., "Fetch Metadata". And long term might allow for optimizations.

@mnot you should probably have a quick skim as well.

> @@ -564,6 +572,22 @@ A: 3
  <var>name</var> and <a for=header>value</a> is <var>value</var> to <var>list</var>.
 </ol>
 
+<p>To <dfn export for="header list" id=concept-header-list-set-structured-header>set a structured
+header</dfn> <a for=header>name</a>/<a>structured header</a>
+<var>name</var>/<var>structured header</var> pair in a <a for=/>header list</a> <var>list</var>, run
+these steps:
+
+<ol>
+ <li>Let <var>serialized value</var> be the result of executing the <a>serializing structured
+ headers</a> algorithm on <var>structured header</var>.
+ <li><a for="header list">Set</a> <var>name</var>/<var>serialized value</var> in <var>list</var>.
+</ol>
+
+<p class="note">Structured header values are defined as objects which HTTP can (eventually)
+serialize in interesting and efficient ways. [[!HEADER-STRUCTURE]] For the moment, Fetch only
+supports setting these objects in <a for=/>header lists</a> by first serializing them into a
+string representation.

I suppose we should nevertheless encourage folks to use this setter to receive benefits later.

> @@ -564,6 +572,22 @@ A: 3
  <var>name</var> and <a for=header>value</a> is <var>value</var> to <var>list</var>.
 </ol>
 
+<p>To <dfn export for="header list" id=concept-header-list-set-structured-header>set a structured
+header</dfn> <a for=header>name</a>/<a>structured header</a>

I filed https://github.com/httpwg/http-extensions/issues/908 as this reads rather awkward.

> @@ -81,6 +83,12 @@ url:https://tools.ietf.org/html/rfc7234#section-1.2.1;text:delta-seconds;type:df
     },
     "OCSP": {
         "aliasOf": "RFC2560"
+    },
+    "HEADER-STRUCTURE": {
+        "authors": ["Mark Nottingham","Paul-Henning Kamp"],
+        "href": "https://httpwg.org/http-extensions/draft-ietf-httpbis-header-structure.html",

I suppose we should use the tools.ietf.org version, unless we want to update all?

-- 
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/925#pullrequestreview-280765778

Received on Wednesday, 28 August 2019 11:46:23 UTC