Skip to content

Commit 882e11b

Browse files
committed
http2: fix hanging of Http2ServerResponse's end method with no data
Fixes: #38258
1 parent aefc621 commit 882e11b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/http2/compat.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,9 @@ class Http2ServerResponse extends Stream {
755755
}
756756

757757
if (chunk !== null && chunk !== undefined)
758-
this.write(chunk, encoding);
758+
chunk = '';
759+
760+
this.write(chunk, encoding);
759761

760762
state.headRequest = stream.headRequest;
761763
state.ending = true;

0 commit comments

Comments
 (0)