mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
test: test case for multiple res.writeHead and res.getHeader
PR-URL: https://github.com/nodejs/node/pull/45508 Fixes: https://github.com/nodejs/node/issues/36721 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
be9cd3ecb0
commit
c03354d3e0
3 changed files with 29 additions and 3 deletions
|
@ -331,6 +331,11 @@ ServerResponse.prototype._implicitHeader = function _implicitHeader() {
|
|||
|
||||
ServerResponse.prototype.writeHead = writeHead;
|
||||
function writeHead(statusCode, reason, obj) {
|
||||
|
||||
if (this._header) {
|
||||
throw new ERR_HTTP_HEADERS_SENT('write');
|
||||
}
|
||||
|
||||
const originalStatusCode = statusCode;
|
||||
|
||||
statusCode |= 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue