Skip to content

Commit 11947fa

Browse files
fix: changed error label
1 parent 46e0893 commit 11947fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/_http_server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ ServerResponse.prototype.writeHead = writeHead;
333333
function writeHead(statusCode, reason, obj) {
334334

335335
if (this._header) {
336-
throw new ERR_HTTP_HEADERS_SENT('writeHead');
336+
throw new ERR_HTTP_HEADERS_SENT('write');
337337
}
338338

339339
const originalStatusCode = statusCode;

test/parallel/test-http-write-head.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const s = http.createServer(common.mustCall((req, res) => {
5858
}, {
5959
code: 'ERR_HTTP_HEADERS_SENT',
6060
name: 'Error',
61-
message: 'Cannot writeHead headers after they are sent to the client'
61+
message: 'Cannot write headers after they are sent to the client'
6262
});
6363

6464
res.end();
@@ -83,7 +83,7 @@ function runTest() {
8383
assert.throws(() => res.writeHead(200, [ 'test2', '2' ]), {
8484
code: 'ERR_HTTP_HEADERS_SENT',
8585
name: 'Error',
86-
message: 'Cannot writeHead headers after they are sent to the client'
86+
message: 'Cannot write headers after they are sent to the client'
8787
});
8888
res.end();
8989
});

0 commit comments

Comments
 (0)