From 29ccd524a76b3553aef7d515f9d94be75cdff33b Mon Sep 17 00:00:00 2001 From: Adam Henson Date: Sat, 23 Jul 2016 00:32:26 -0400 Subject: [PATCH] Fixes #107: Allow frames after RST_STREAM. Prevent exceptions for the common case in which the serving endpoint sends frames after the RST_STREAM has been sent from the client endpoint. Often frames are enqueued prior to the arrival of the RST_STREAM, but sent after. This should be expected based on HTTP/2 spec, section 6.4. https://http2.github.io/http2-spec/#rfc.section.6.4 "However, after sending the RST_STREAM, the sending endpoint MUST be prepared to receive and process additional frames sent on the stream that might have been sent by the peer prior to the arrival of the RST_STREAM." --- lib/protocol/stream.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/protocol/stream.js b/lib/protocol/stream.js index b8c3cc4..6d029dc 100644 --- a/lib/protocol/stream.js +++ b/lib/protocol/stream.js @@ -567,6 +567,7 @@ Stream.prototype._transition = function transition(sending, frame) { // can be used to close any of those streams. case 'CLOSED': if (PRIORITY || (sending && RST_STREAM) || + (sending && this._closedWithRst) || (receiving && WINDOW_UPDATE) || (receiving && this._closedByUs && (this._closedWithRst || RST_STREAM || ALTSVC))) {