Open Dagrut opened 6 years ago
@Dagrut did you manage to find a fix or a workaround? I also think it's a Spdy bug.
Can comfirm it. Is there s solution?
For anyone still looking for a solution, this (adapted slightly from the proposal above) seems to work without requiring a fork.
Thanks @mykiimike!
server.on('request', (req, res) => {
res.spdyStream.once('finish', () => res.emit('finish'));
});
I had a problem using https://github.com/binarysec/gate, so I made a shorter version of this bug below. The bug is that the
close
event of the response is called even if the connection ended correctly, and so thefinish
event is never called (close
means that there were still data to be sent to the client, but the connection closed before the.end()
). It seems to only happen in HTTP/2, not HTTP/1.1. Also, this bug happens with bot the latest v4 and v6 of nodejs (debian repo version). It may be a nodejs bug or a spdy bug, so I thought I would ask it here first. To reproduce it, here are the steps :Test case
This test focuses on request forwarding, but you may make a shorter version too.
Create ssl certs
Install dependancies
Set host
Add this to your system hosts file :
server.js
Put this in a file called
server.js
:Run server
Test
Go to https://www.materiel.net/ (using firefox in my case, but any browser supporting HTTP/2 should do).