Open
Description
- Version: v14.10.1
- Platform: macOS 10.15.6
- Subsystem: http2
What steps will reproduce the bug?
- Setup a http2 server that will:
a. Send a response containing acontent-length
header.
b. Stall after transmitting part of the data (or just the headers).
c. Stop the transmission with aRST_STREAM
frame witherror_code = 0
. - Create a http2 client (new or old api), and call the server, trying to receive the content.
- Validate that
content-length
bytes have been received.
FYI, I don't know how to setup such a server, though it can occur naturally with envoy in http2 mode.
How often does it reproduce? Is there a required condition?
100%. It requires the stream to be closed with a RST_STREAM
frame containing error_code = 0
.
What is the expected behavior?
http2 client emits an error.
What do you see instead?
No error. Just a partial response, with less than content-length
bytes.
Additional information
This is caused by an nghttp2 bug: nghttp2/nghttp2#1508
The bug causes this callback to be called with code = NGHTTP2_NO_ERROR
when the server sends a RST_STREAM
frame with error_code = 0
for an active stream.
More details in my initial reported issue here: sindresorhus/got#1462