From 6f032a280bd5dafba187dc8675b9f7ed6dda899d Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Mon, 22 May 2023 09:18:33 +0200 Subject: [PATCH] Editorial: define return types of most header list algorithms Fixes #1659. --- fetch.bs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/fetch.bs b/fetch.bs index e8a2d201..7ee7d97f 100644 --- a/fetch.bs +++ b/fetch.bs @@ -586,7 +586,8 @@ efficient representation, as long as they also support an associated data struct

To get a structured field value given a header name name and a string type from a -header list list, run these steps: +header list list, run these steps. They return null or a +structured field value.

  1. Assert: type is one of "dictionary", "list", or @@ -615,7 +616,7 @@ given a header name name and a string type fr

    To set a structured field value given a tuple (header name name, structured field value -structuredValue), in a header list list, run these steps: +structuredValue), in a header list list:

    1. Let serializedValue be the result of executing the @@ -645,7 +646,8 @@ preserved end-to-end. [[!RFC8941]]

      To get a header name -name from a header list list, run these steps: +name from a header list list, run these steps. They return null +or a header value.

      1. If list does not contain name, then return @@ -661,7 +663,8 @@ preserved end-to-end. [[!RFC8941]]

        To get, decode, and split a header name name from header list list, run these -steps: +steps. They return null or a list of strings. +

        1. Let value be the result of getting name from @@ -750,7 +753,9 @@ A: 3

          To get, decode, and split -a header value value, run these steps: +a header value value, run these steps. They return a list of +strings. +

          1. Let input be the result of isomorphic decoding value. @@ -815,7 +820,7 @@ directly. Use get, decode, and split instead.

            To append a header -(name, value) to a header list list, run these steps: +(name, value) to a header list list:

            1. @@ -839,7 +844,7 @@ directly. Use get, decode, and split instead.

              To set a header -(name, value) in a header list list, run these steps: +(name, value) in a header list list:

              1. If list contains name, then set the @@ -853,7 +858,7 @@ directly. Use get, decode, and split instead.

                To combine a header (name, value) in a header list -list, run these steps: +list:

                1. If list contains name, then set the @@ -869,7 +874,8 @@ directly. Use get, decode, and split instead.

                  To convert header names to a sorted-lowercase set, given a list of -names headerNames, run these steps: +names headerNames, run these steps. They return an +ordered set of header names.

                  1. Let headerNamesSet be a new ordered set. @@ -885,11 +891,10 @@ directly. Use get, decode, and split instead.

                    To sort and combine a -header list list: +header list list, run these steps. They return a header list.

                      -
                    1. Let headers be an empty list of headers with the key - being the name and value the value. +

                    2. Let headers be a header list.

                    3. Let names be the result of convert header names to a sorted-lowercase set with all the names