Skip to content

Commit 6f032a2

Browse files
authored
Editorial: define return types of most header list algorithms
Fixes #1659.
1 parent 086e35f commit 6f032a2

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

fetch.bs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,8 @@ efficient representation, as long as they also support an associated data struct
586586
<p>To
587587
<dfn export for="header list" id=concept-header-list-get-structured-header>get a structured field value</dfn>
588588
given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> from a
589-
<a for=/>header list</a> <var>list</var>, run these steps:
589+
<a for=/>header list</a> <var>list</var>, run these steps. They return null or a
590+
<a>structured field value</a>.
590591

591592
<ol>
592593
<li><p>Assert: <var>type</var> is one of "<code>dictionary</code>", "<code>list</code>", or
@@ -615,7 +616,7 @@ given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> fr
615616
<p>To
616617
<dfn export for="header list" id=concept-header-list-set-structured-header>set a structured field value</dfn>
617618
given a <a for=/>tuple</a> (<a for=/>header name</a> <var>name</var>, <a>structured field value</a>
618-
<var>structuredValue</var>), in a <a for=/>header list</a> <var>list</var>, run these steps:
619+
<var>structuredValue</var>), in a <a for=/>header list</a> <var>list</var>:
619620

620621
<ol>
621622
<li><p>Let <var>serializedValue</var> be the result of executing the
@@ -645,7 +646,8 @@ preserved end-to-end. [[!RFC8941]]
645646

646647
<div algorithm>
647648
<p>To <dfn export for="header list" id=concept-header-list-get>get</dfn> a <a for=/>header name</a>
648-
<var>name</var> from a <a for=/>header list</a> <var>list</var>, run these steps:
649+
<var>name</var> from a <a for=/>header list</a> <var>list</var>, run these steps. They return null
650+
or a <a for=/>header value</a>.
649651

650652
<ol>
651653
<li><p>If <var>list</var> <a for="header list">does not contain</a> <var>name</var>, then return
@@ -661,7 +663,8 @@ preserved end-to-end. [[!RFC8941]]
661663
<p>To
662664
<dfn export for="header list" lt="get, decode, and split|getting, decoding, and splitting" id=concept-header-list-get-decode-split>get, decode, and split</dfn>
663665
a <a for=/>header name</a> <var>name</var> from <a for=/>header list</a> <var>list</var>, run these
664-
steps:
666+
steps. They return null or a <a for=/>list</a> of <a for=/>strings</a>.
667+
<!-- "isomorphic" strings -->
665668

666669
<ol>
667670
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var> from
@@ -750,7 +753,9 @@ A: 3
750753
<div algorithm>
751754
<p>To
752755
<dfn for="header value" lt="get, decode, and split|getting, decoding, and splitting">get, decode, and split</dfn>
753-
a <a for=/>header value</a> <var>value</var>, run these steps:
756+
a <a for=/>header value</a> <var>value</var>, run these steps. They return a <a for=/>list</a> of
757+
<a for=/>strings</a>.
758+
<!-- "isomorphic" strings -->
754759

755760
<ol>
756761
<li><p>Let <var>input</var> be the result of <a>isomorphic decoding</a> <var>value</var>.
@@ -815,7 +820,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
815820

816821
<div algorithm>
817822
<p>To <dfn export for="header list" id=concept-header-list-append>append</dfn> a <a for=/>header</a>
818-
(<var>name</var>, <var>value</var>) to a <a for=/>header list</a> <var>list</var>, run these steps:
823+
(<var>name</var>, <var>value</var>) to a <a for=/>header list</a> <var>list</var>:
819824

820825
<ol>
821826
<li>
@@ -839,7 +844,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
839844

840845
<div algorithm>
841846
<p>To <dfn export for="header list" id=concept-header-list-set>set</dfn> a <a for=/>header</a>
842-
(<var>name</var>, <var>value</var>) in a <a for=/>header list</a> <var>list</var>, run these steps:
847+
(<var>name</var>, <var>value</var>) in a <a for=/>header list</a> <var>list</var>:
843848

844849
<ol>
845850
<li><p>If <var>list</var> <a for="header list">contains</a> <var>name</var>, then set the
@@ -853,7 +858,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
853858
<div algorithm>
854859
<p>To <dfn export for="header list" id=concept-header-list-combine>combine</dfn> a
855860
<a for=/>header</a> (<var>name</var>, <var>value</var>) in a <a for=/>header list</a>
856-
<var>list</var>, run these steps:
861+
<var>list</var>:
857862

858863
<ol>
859864
<li><p>If <var>list</var> <a for="header list">contains</a> <var>name</var>, then set the
@@ -869,7 +874,8 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
869874

870875
<div algorithm>
871876
<p>To <dfn>convert header names to a sorted-lowercase set</dfn>, given a <a for=/>list</a> of
872-
<a lt=name for=header>names</a> <var>headerNames</var>, run these steps:
877+
<a lt=name for=header>names</a> <var>headerNames</var>, run these steps. They return an
878+
<a for=/>ordered set</a> of <a for=/>header names</a>.
873879

874880
<ol>
875881
<li><p>Let <var>headerNamesSet</var> be a new <a for=/>ordered set</a>.
@@ -885,11 +891,10 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
885891

886892
<div algorithm>
887893
<p>To <dfn export for="header list" id=concept-header-list-sort-and-combine>sort and combine</dfn> a
888-
<a for=/>header list</a> <var>list</var>:
894+
<a for=/>header list</a> <var>list</var>, run these steps. They return a <a for=/>header list</a>.
889895

890896
<ol>
891-
<li><p>Let <var>headers</var> be an empty <a for=/>list</a> of <a for=/>headers</a> with the key
892-
being the <a for=header>name</a> and value the <a for=header>value</a>.
897+
<li><p>Let <var>headers</var> be a <a for=/>header list</a>.
893898

894899
<li><p>Let <var>names</var> be the result of
895900
<a>convert header names to a sorted-lowercase set</a> with all the <a lt=name for=header>names</a>

0 commit comments

Comments
 (0)