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
btw, I renamed the name of parameters for better coding experience
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines