Skip to content

lib: refactor ServerResponse.prototype.writeHead

fix #32395 (closed)

make HTTP and HTTP2 the behavior the same.

example, allow response.writeHead(200, undefined, { ...headers }) when the second parameter is undefined passing

https://github.com/nodejs/node/blob/d129e0c782914df8720d1335c95bd7f635f2788e/lib/internal/http2/compat.js#L608-L620

btw, I renamed the name of parameters for better coding experience

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

Merge request reports

Loading