Skip to content

Commit 3613e8d

Browse files
committed
tests, http: fixed call to ERR_HTTP_INCOMING_SOCKET_ENCODING
internal/errors declaration updated to match new scheme PR-URL: nodejs#19344 Ref: https://tools.ietf.org/html/rfc7230#section-3 Ref: nodejs#18118 Ref: nodejs#18178 Ref: nodejs#19344
1 parent f3c429c commit 3613e8d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/_http_server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const {
4545
const { IncomingMessage } = require('_http_incoming');
4646
const {
4747
ERR_HTTP_HEADERS_SENT,
48+
ERR_HTTP_INCOMING_SOCKET_ENCODING,
4849
ERR_HTTP_INVALID_STATUS_CODE,
4950
ERR_INVALID_CHAR
5051
} = require('internal/errors').codes;
@@ -685,7 +686,7 @@ function onSocketPause() {
685686
}
686687

687688
function socketSetEncoding() {
688-
throw new errors.Error('ERR_HTTP_INCOMING_SOCKET_ENCODING', 'setEncoding');
689+
throw new ERR_HTTP_INCOMING_SOCKET_ENCODING('setEncoding');
689690
}
690691

691692
function unconsume(parser, socket) {

lib/internal/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ E('ERR_HTTP2_UNSUPPORTED_PROTOCOL', 'protocol "%s" is unsupported.', Error);
763763
E('ERR_HTTP_HEADERS_SENT',
764764
'Cannot %s headers after they are sent to the client', Error);
765765
E('ERR_HTTP_INCOMING_SOCKET_ENCODING',
766-
'Changing the incoming socket encoding is not possible (see RFC7230 Section 3)',
766+
'Changing the incoming socket encoding is not possible (RFC7230 Section 3)',
767767
Error);
768768
E('ERR_HTTP_INVALID_HEADER_VALUE',
769769
'Invalid value "%s" for header "%s"', TypeError);

0 commit comments

Comments
 (0)