Skip to content

http2: fix closedCode NaN, increase test coverage

[kFinish](code) can be triggered without passing code. Until now, the method tried to set closedCode to undefined resulting in NaN closedCode instead of NGHTTP2_NO_ERROR. Added a check for code !== undefined before setting.

Also adds tests for closed (request only, response covered by another PR previously) and closedCode (both).

Adds tests for Http2ServerRequest and Http2ServerResponse setTimeout. Edit: separate PR now: https://github.com/nodejs/node/pull/15156

Let me know if there's anything I can change. Thanks!

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

http2, test

Merge request reports

Loading