@@ -18,6 +18,7 @@ url:https://tools.ietf.org/html/rfc7230#section-3.1.2;text:reason-phrase;type:df
18
18
url:https://tools.ietf.org/html/rfc7234#section-1.2.1;text:delta-seconds;type:dfn;spec:http-caching
19
19
url:https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#section-2;text:structured header value;type:dfn;spec:header-structure
20
20
url:https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#section-4.1;text:serializing structured headers;type:dfn;spec:header-structure
21
+ url:https://tools.ietf.org/html/draft-ietf-httpbis-header-structure#section-4.2;text:parsing structured headers;type:dfn;spec:header-structure
21
22
</pre>
22
23
23
24
<pre class=biblio>
@@ -380,6 +381,50 @@ for consistency.
380
381
<p class="note no-backref"> A <a for=/>header list</a> is essentially a
381
382
specialized multimap. An ordered list of key-value pairs with potentially duplicate keys.
382
383
384
+ <p> To
385
+ <dfn export for="header list" id=concept-header-list-get-structured-header>get a structured header</dfn>
386
+ given a <var> name</var> and a <var> type</var> from a <a for=/>header list</a> <var> list</var> , run
387
+ these steps:
388
+
389
+ <ol>
390
+ <li><p> Assert: <var> type</var> is one of "<code> dictionary</code> ", "<code> list</code> ", or
391
+ "<code> item</code> ".
392
+
393
+ <li><p> Let <var> value</var> be the result of <a for="header list">getting</a> <var> name</var> from
394
+ <var> list</var> .
395
+
396
+ <li><p> If <var> value</var> is null, then return null.
397
+
398
+ <li><p> Let <var> result</var> be the result of executing the <a>parsing structured headers</a>
399
+ algorithm with <var ignore> input_string</var> set to <var> value</var> , and
400
+ <var ignore> header_type</var> set to <var> type</var> .
401
+
402
+ <li><p> If parsing failed, then return failure.
403
+
404
+ <li><p> Return <var> result</var> .
405
+ </ol>
406
+
407
+ <p> To
408
+ <dfn export for="header list" id=concept-header-list-set-structured-header>set a structured header</dfn>
409
+ <a for=header>name</a> /<a>structured header value</a> <var> name</var> /<var> structuredValue</var>
410
+ pair in a <a for=/>header list</a> <var> list</var> , run these steps:
411
+
412
+ <ol>
413
+ <li><p> Let <var> serializedValue</var> be the result of executing the
414
+ <a>serializing structured headers</a> algorithm on <var> structuredValue</var> .
415
+
416
+ <li><p> <a for="header list">Set</a> <var> name</var> /<var> serializedValue</var> in <var> list</var> .
417
+ </ol>
418
+
419
+ <p class=note> <a>Structured header values</a> are defined as objects which HTTP can (eventually)
420
+ serialize in interesting and efficient ways. For the moment, Fetch only supports <a for=/>header</a>
421
+ <a for=header>values</a> as <a for=/>byte sequences</a> , which means that these objects can be set
422
+ in <a for=/>header lists</a> only via serialization, and they can be obtained from
423
+ <a for=/>header lists</a> only by parsing. In the future the fact that they are objects might be
424
+ preserved end-to-end. [[!HEADER-STRUCTURE]]
425
+
426
+ <hr>
427
+
383
428
<p> A <a for=/>header list</a> <var> list</var>
384
429
<dfn export for="header list" lt="contains|does not contain">contains</dfn> a <a for=header>name</a>
385
430
<var> name</var> if <var> list</var> <a for=list>contains</a> a <a for=/>header</a> whose
@@ -572,23 +617,6 @@ A: 3
572
617
<var> name</var> and <a for=header>value</a> is <var> value</var> to <var> list</var> .
573
618
</ol>
574
619
575
- <p> To
576
- <dfn export for="header list" id=concept-header-list-set-structured-header>set a structured header</dfn>
577
- <a for=header>name</a> /<a>structured header value</a> <var> name</var> /<var> structuredValue</var>
578
- pair in a <a for=/>header list</a> <var> list</var> , run these steps:
579
-
580
- <ol>
581
- <li><p> Let <var> serializedValue</var> be the result of executing the
582
- <a>serializing structured headers</a> algorithm on <var> structuredValue</var> .
583
-
584
- <li><p> <a for="header list">Set</a> <var> name</var> /<var> serializedValue</var> in <var> list</var> .
585
- </ol>
586
-
587
- <p class="note"> <a>Structured header values</a> are defined as objects which HTTP can (eventually)
588
- serialize in interesting and efficient ways. For the moment, Fetch only supports setting these
589
- objects in <a for=/>header lists</a> by serializing them. In the future the fact that they are
590
- objects might be preserved end-to-end. [[!HEADER-STRUCTURE]]
591
-
592
620
<p> To <dfn export for="header list" id=concept-header-list-combine>combine</dfn> a
593
621
<a for=header>name</a> /<a for=header>value</a> <var> name</var> /<var> value</var> pair in a
594
622
<a for=/>header list</a> <var> list</var> , run these steps:
0 commit comments