Structured Headers for HTTP: non-ASCII

Structured Headers for HTTP
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07

4.2.  Parsing HTTP/1 Header Fields into Structured Headers
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2

|   If parsing fails - including when calling another algorithm - the
|   entire header field's value MUST be discarded.  This is intentionally
|   strict, to improve interoperability and safety, and specifications
|   referencing this document cannot loosen this requirement.
|
|   Note that this has the effect of discarding any header field with
|   non-ASCII characters in input_string.

But parsing algorith seems missing text:

	If non-ASCII characters seen, fail parsing.

All algrithm have text

	"Given an ASCII string input_string"

so they do not apply situation when there is non-ASCII characters.


4.2.  Parsing HTTP/1 Header Fields into Structured Headers
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2

|   Given an ASCII string input_string that represents the chosen
|   header's field-value, and header_type, one of "dictionary", "list",
|   "param-list", or "item", return the parsed header value.
 
4.2.1.  Parsing a Dictionary from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.1

|   Given an ASCII string input_string, return a mapping of (identifier,
|   item). input_string is modified to remove the parsed value.

4.2.2.  Parsing a List from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.2

|   Given an ASCII string input_string, return a list of items.
|   input_string is modified to remove the parsed value.

4.2.3.  Parsing a Parameterised List from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.3

|   Given an ASCII string input_string, return a list of parameterised
|   identifiers. input_string is modified to remove the parsed value.

4.2.4.  Parsing a Parameterised Identifier from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.4

|   Given an ASCII string input_string, return a identifier with an
|   mapping of parameters. input_string is modified to remove the parsed
|   value.

4.2.5.  Parsing an Item from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.5

|   Given an ASCII string input_string, return an item. input_string is
|   modified to remove the parsed value.

4.2.6.  Parsing a Number from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.6

|   NOTE: This algorithm parses both Integers Section 3.5 and Floats
|   Section 3.6, and returns the corresponding structure.

  4.2.6 seems to have exception, because it does not limit itself to
  "Given an ASCII string input_string" (but referring
     4.2.  Parsing HTTP/1 Header Fields into Structured Headers
  limits itself to  "Given an ASCII string input_string" ).


4.2.7.  Parsing a String from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.7

|   Given an ASCII string input_string, return an unquoted string.
|   input_string is modified to remove the parsed value.

4.2.8.  Parsing an Identifier from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.8

|   Given an ASCII string input_string, return a identifier. input_string
|   is modified to remove the parsed value.

4.2.9.  Parsing Binary Content from Text
https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-07#section-4.2.9

|   Given an ASCII string input_string, return binary content.
|   input_string is modified to remove the parsed value.



So there seems to missing top level algorithm, which is

    Given an string input_string, return parsed context.

    1. Check input_string character values.

       1. If all characters are on range %x00-%x7f,
          let output be the result of 
          Parsing HTTP/1 Header Fields into Structured Headers
          (Section 4.2)

       2. Otherwise, fail parsing.


/ Kari Hurtta

Received on Monday, 2 July 2018 19:09:28 UTC