Skip to content

Commit

Permalink
http2: fix hanging of Http2ServerResponse's end method with no data
Browse files Browse the repository at this point in the history
Fixes: #38258
  • Loading branch information
pd4d10 committed May 13, 2021
1 parent aefc621 commit 882e11b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,9 @@ class Http2ServerResponse extends Stream {
}

if (chunk !== null && chunk !== undefined)
this.write(chunk, encoding);
chunk = '';

this.write(chunk, encoding);

state.headRequest = stream.headRequest;
state.ending = true;
Expand Down

0 comments on commit 882e11b

Please sign in to comment.