-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: fetch causes http2 server to hang #2311
Comments
const server = http2.createSecureServer(ssl, async (req, res) => {
assert.equal(req.method, "POST");
console.log("beginning to read body...");
let body = [];
req.on("data", (chunk) => {
body.push(chunk);
});
let buffer = Buffer.concat(body);
console.log("end of reading body");
res.end(buffer);
}).listen(3000);
|
Of course, that's just because I'm only responding with the first const server = http2.createSecureServer(ssl, async (req, res) => {
assert.equal(req.method, "POST");
console.log("beginning to read body...");
let body = [];
req.on("data", (chunk) => {
body.push(chunk);
});
req.on("end", () => {
let buffer = Buffer.concat(body);
console.log("end of reading body");
res.end(buffer);
})
}).listen(3000); |
Failing test vegerot@f2519dc |
@strager found that Node I don't know what "partial entity body" means, but our hypothesis is that Node |
Does it fail if you only use |
thanks @metcoder95
I'm using I added a test to undici to reproduce the bug (I think) |
Found the issue, basically |
Bug Description
Reading the
body
of an http2 POST call causesnode:http2
to hang when called from thisfetch
, but not from Deno's fetch or curl.Reproducible By
Play around with the value of
METHOD
to see what I'm talking aboutExpected Behavior
both
curl
andfetch
should receive a response quickly.Instead,
curl
gets a response immediately butfetch
never returns.Logs & Screenshots
Environment
node v20.3.1
Linux maxs-pc 5.19.0-43-generic #44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon May 22 13:39:36 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Additional context
I have tested this code with
Client#request
❌The text was updated successfully, but these errors were encountered: