Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: define return types of most header list algorithms #1660

Merged
merged 2 commits into from
May 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ efficient representation, as long as they also support an associated data struct
<p>To
<dfn export for="header list" id=concept-header-list-get-structured-header>get a structured field value</dfn>
given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> from a
<a for=/>header list</a> <var>list</var>, run these steps:
<a for=/>header list</a> <var>list</var>, run these steps. They return null or a
<a>structured field value</a>.

<ol>
<li><p>Assert: <var>type</var> is one of "<code>dictionary</code>", "<code>list</code>", or
Expand Down Expand Up @@ -615,7 +616,8 @@ given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> fr
<p>To
<dfn export for="header list" id=concept-header-list-set-structured-header>set a structured field value</dfn>
given a <a for=/>tuple</a> (<a for=/>header name</a> <var>name</var>, <a>structured field value</a>
<var>structuredValue</var>), in a <a for=/>header list</a> <var>list</var>, run these steps:
<var>structuredValue</var>), in a <a for=/>header list</a> <var>list</var>, run these steps. They
return nothing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary for the setter-type algorithms IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.


<ol>
<li><p>Let <var>serializedValue</var> be the result of executing the
Expand Down Expand Up @@ -645,7 +647,8 @@ preserved end-to-end. [[!RFC8941]]

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

<ol>
<li><p>If <var>list</var> <a for="header list">does not contain</a> <var>name</var>, then return
Expand All @@ -661,7 +664,8 @@ preserved end-to-end. [[!RFC8941]]
<p>To
<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>
a <a for=/>header name</a> <var>name</var> from <a for=/>header list</a> <var>list</var>, run these
steps:
steps. They return null or a <a for=/>list</a> of <a for=/>strings</a>.
<!-- "isomorphic" strings -->

<ol>
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var> from
Expand Down Expand Up @@ -750,7 +754,9 @@ A: 3
<div algorithm>
<p>To
<dfn for="header value" lt="get, decode, and split|getting, decoding, and splitting">get, decode, and split</dfn>
a <a for=/>header value</a> <var>value</var>, run these steps:
a <a for=/>header value</a> <var>value</var>, run these steps. They return a <a for=/>list</a> of
<a for=/>strings</a>.
<!-- "isomorphic" strings -->

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

<div algorithm>
<p>To <dfn export for="header list" id=concept-header-list-append>append</dfn> a <a for=/>header</a>
(<var>name</var>, <var>value</var>) to a <a for=/>header list</a> <var>list</var>, run these steps:
(<var>name</var>, <var>value</var>) to a <a for=/>header list</a> <var>list</var>, run these steps.
They return nothing.

<ol>
<li>
Expand All @@ -839,7 +846,8 @@ directly. Use <a for="header list">get, decode, and split</a> instead.

<div algorithm>
<p>To <dfn export for="header list" id=concept-header-list-set>set</dfn> a <a for=/>header</a>
(<var>name</var>, <var>value</var>) in a <a for=/>header list</a> <var>list</var>, run these steps:
(<var>name</var>, <var>value</var>) in a <a for=/>header list</a> <var>list</var>, run these steps.
They return nothing.

<ol>
<li><p>If <var>list</var> <a for="header list">contains</a> <var>name</var>, then set the
Expand All @@ -853,7 +861,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
<div algorithm>
<p>To <dfn export for="header list" id=concept-header-list-combine>combine</dfn> a
<a for=/>header</a> (<var>name</var>, <var>value</var>) in a <a for=/>header list</a>
<var>list</var>, run these steps:
<var>list</var>, run these steps. They return nothing.

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

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

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

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

<ol>
<li><p>Let <var>headers</var> be an empty <a for=/>list</a> of <a for=/>headers</a> with the key
being the <a for=header>name</a> and value the <a for=header>value</a>.
<li><p>Let <var>headers</var> be a <a for=/>header list</a>.

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