Structured Fields: strict error handling (#2399)

<https://github.com/httpwg/http-extensions/issues/2399>

With my editor hat on:

Section 2, "Defining Structured Fields" says:

> When parsing fails, the entire field is ignored (see Section 4.2); in most situations, violating field-specific constraints should have the same effect. Thus, if a header is defined as an Item and required to be an Integer, but a String is received, the field will by default be ignored. If the field requires different error handling, this should be explicitly specified.

whereas Section 4.2 says:

> If parsing fails -- including when calling another algorithm -- the entire field value MUST be ignored (i.e., treated as if the field were not present in the section). This is intentionally strict, to improve interoperability and safety, and specifications referencing this document are not allowed to loosen this requirement.

Julian points out that this is inconsistent.

I see Section 4.2 applying to the behaviour of generic parser implementations, whereas Section 2 is allowing individual fields to specify fallback behaviour when parsing fails. I do agree this could be clarified, though.

I made an attempt here:
  https://github.com/httpwg/http-extensions/commit/167e840515a

Thoughts?

--
Mark Nottingham   https://www.mnot.net/

Received on Sunday, 26 February 2023 23:10:42 UTC