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
fix: changed error label
  • Loading branch information
marco-ippolito committed Nov 23, 2022
commit 9ac34d7b2be5c35d7717e53ff8c44e13c4b1b4cc
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ ServerResponse.prototype.writeHead = writeHead;
function writeHead(statusCode, reason, obj) {

if (this._header) {
throw new ERR_HTTP_HEADERS_SENT('writeHead');
throw new ERR_HTTP_HEADERS_SENT('write');
}

const originalStatusCode = statusCode;
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-write-head.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const s = http.createServer(common.mustCall((req, res) => {
}, {
code: 'ERR_HTTP_HEADERS_SENT',
name: 'Error',
message: 'Cannot writeHead headers after they are sent to the client'
message: 'Cannot write headers after they are sent to the client'
});

res.end();
Expand All @@ -83,7 +83,7 @@ function runTest() {
assert.throws(() => res.writeHead(200, [ 'test2', '2' ]), {
code: 'ERR_HTTP_HEADERS_SENT',
name: 'Error',
message: 'Cannot writeHead headers after they are sent to the client'
message: 'Cannot write headers after they are sent to the client'
});
res.end();
});
Expand Down