Subject: [quicwg/base-drafts] Signal error upon receipt of multiple trailing HEADERS (#2858)

From: Bence Béky <[email-masked]>
Date: Fri, 28 Jun 2019 07:58:57 -0700

According to https://quicwg.org/base-drafts/draft-ietf-quic-http.html#request-response, a  bidirectional HTTP stream can have at least one HEADERS frame (exactly one if the stream is client-initiated), zero or more DATA frames, then zero or one HEADERS frame, in this order.  Handling the receipt of frames that does not conform to this requirement is inconsistent:

(1) If a DATA frame is received before any other frame, that's an error:
> If a DATA frame is received before a HEADERS frame [...], the recipient MUST respond with a connection error of type HTTP_UNEXPECTED_FRAME [...].

(2) If the trailing HEADERS frame is followed by another HEADERS frame, that is to be discarded:
> Trailing header fields are carried in an additional HEADERS frame following the body. Senders MUST send only one HEADERS frame in the trailers section; receivers MUST discard any subsequent HEADERS frames.

(3) There is no guidance on how to handle a DATA frame after the trailing headers.

I suggest that every violation to this requirement should be an error.  (I do not feel strongly whether a connection error like (1) is handled right now, or a stream error.  The implementation I am contributing to will promote most stream errors to connection errors regardless.)

Note that (2) comes from the technical limitation that header blocks needed to be processed, which is not the case any longer with QPACK.  It just seems like that when the requirement to decode the header block was removed at https://github.com/quicwg/base-drafts/commit/404c5b8ee838042f7269574b608d1b15e2a25fd9, adding the requirement to signal an error was not in scope of that commit.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2858

---

From: Lucas Pardue <[email-masked]>
Date: Fri, 28 Jun 2019 08:09:32 -0700

I agree with @bencebeky .

> If a DATA frame is received before a HEADERS frame [...], the recipient MUST respond with a connection error of type HTTP_UNEXPECTED_FRAME [...].

If you read that requirement a certain way, then any use of trailers will blow up the connection :) I think we could rewrite this text to be clearer about when DATA frames are expected to be received.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2858#issuecomment-506769036

---

From: Mike Bishop <[email-masked]>
Date: Fri, 28 Jun 2019 09:41:10 -0700

Good points.  Let's continue tightening down the screws.  :-)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/2858#issuecomment-506799949