Re: Last Call: <draft-ietf-httpbis-header-structure-18.txt> (Structured Field Values for HTTP) to Proposed Standard

Hi Julian,

> On 13 May 2020, at 1:59 pm, Julian Reschke <julian.reschke@gmx.de> wrote:
> 
> Hi there,
> 
> I note that this mail was cc'd to the HTTP WG mailing list
> (ietf-http-wg@w3.org), but apparently didn't make it there (see
> <https://lists.w3.org/Archives/Public/ietf-http-wg/2020AprJun/>). We
> really should find out what went wrong here.
> 
> (the same seems to have happened for the LC on
> draft-ietf-httpbis-client-hints-13 a few days later)

Will look into it.

> I'll use that as somewhat lame excuse for a very late comment on the
> document (I've been working on an implementation and this came up just
> yesterday):
> 
> <https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-18#section-4.2>
> says:
> 
>>   When generating input_bytes, parsers MUST combine all lines in the
>>   same section (header or trailer) that case-insensitively match the
>>   field name into one comma-separated field-value, as per [RFC7230],
>>   Section 3.2.2; this assures that the entire field value is processed
>>   correctly.
> 
> It doesn't require *how* to combine these values (and that's ok because
> it can't).

Right; the "how" is in 7230 3.2.2.

> Later on it says:
> 
>>   Strings split across multiple field lines will have unpredictable
>>   results, because comma(s) and whitespace inserted upon combination
>>   will become part of the string output by the parser.  Since
>>   concatenation might be done by an upstream intermediary, the results
>>   are not under the control of the serializer or the parser.
> 
> So there are HTTP messages that can lead to different parsing results,
> depending on what intermediaries do (how *they* combine the lines), and
> what the final recipient does.
> 
> That this can happen for certain inputs is a given; *this* spec can't do
> anything about that as it doesn't control the other parts in the
> transmission chain.

Yes. That part of the text is really an aside explaining how things work, rather than anything normative.

> What bugs me is that we have an invalid message to start with, but the
> spec apparently *requires* receivers to accept it, albeit with
> potentially unpredictable results.
> 
> IMHO it would be better to allow those recipients that *can* detect the
> brokenness to reject these fields.

The problem is that many recipients won't be able to. This includes not only when an intermediary combines multiple field lines into one, but also when a server or library does so (which is more common IME).

We already have potential inconsistency in whitespace caused by such combination. I'm reluctant to add another dimension of inconsistency (whether or not the SH^HF implementation can recognise this situation and reject early).

> If it is really intended to forbid that it might be good to add a short
> explanation why this is the case.

Yes. 

Also, I think we can more clearly prohibit implementations from sending that form (although I doubt it's much of an issue in practice).

Cheers,


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

Received on Friday, 15 May 2020 02:27:35 UTC