From f3c429cf597889a60f1a205819a135c46ec6f1b6 Mon Sep 17 00:00:00 2001 From: Nick Soggin Date: Wed, 14 Mar 2018 15:29:01 -0400 Subject: [PATCH] docs, errors: note RFC compliance in error message and documentation added note and link to RFC7230 >A recipient MUST parse an HTTP message as a sequence of octets in an encoding that is a superset of US-ASCII [USASCII]. Ref: https://tools.ietf.org/html/rfc7230#section-3 Ref: nodejs#18118 Ref: nodejs#18178 Ref: nodejs#19344 --- doc/api/errors.md | 2 +- lib/internal/errors.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/errors.md b/doc/api/errors.md index 5889e6e66a70cd..df8eb06afea490 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -798,7 +798,7 @@ An attempt was made to add more headers after the headers had already been sent. ### ERR_HTTP_INCOMING_SOCKET_ENCODING An attempt was made to manipulate the encoding of an incoming request packet. -This is not allowed (RFC2616). +This is forbidden by [RFC7230 Section 3](https://tools.ietf.org/html/rfc7230#section-3) ### ERR_HTTP_INVALID_HEADER_VALUE diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 426c154fb19557..a63cc1e665b458 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -763,7 +763,7 @@ E('ERR_HTTP2_UNSUPPORTED_PROTOCOL', 'protocol "%s" is unsupported.', Error); E('ERR_HTTP_HEADERS_SENT', 'Cannot %s headers after they are sent to the client', Error); E('ERR_HTTP_INCOMING_SOCKET_ENCODING', - 'Incoming socket encoding is not allowed (RFC 2616)', + 'Changing the incoming socket encoding is not possible (see RFC7230 Section 3)', Error); E('ERR_HTTP_INVALID_HEADER_VALUE', 'Invalid value "%s" for header "%s"', TypeError);