Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
correct the fix
  • Loading branch information
ofir committed Jan 30, 2022
commit 8609ae4634e0b9dbf67605f52f3c55cfdfc07fc9
4 changes: 1 addition & 3 deletions lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,7 @@ class Http2ServerResponse extends Stream {
}

if (chunk !== null && chunk !== undefined)
chunk = '';

this.write(chunk, encoding);
this.write(chunk, encoding);

state.headRequest = stream.headRequest;
state.ending = true;
Expand Down
4 changes: 3 additions & 1 deletion lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,11 @@ function onSessionHeaders(handle, id, cat, flags, headers, sensitiveHeaders) {
}
} else if (cat === NGHTTP2_HCAT_PUSH_RESPONSE) {
event = 'push';
// cat === NGHTTP2_HCAT_HEADERS:
} else if (!endOfStream && status !== undefined && status >= 200) {
event = 'response';
} else if (endOfStream && status !== undefined && status >= 200) {
// cat === NGHTTP2_HCAT_HEADERS
event = 'response';
Comment thread
Linkgoron marked this conversation as resolved.
} else {
event = endOfStream ? 'trailers' : 'headers';
}
Expand Down