http: setEncoding error for incoming socket connections
- added override on
socket.setEncoding
to not allow encoding changes on incoming socket connections - added error
ERR_HTTP_INCOMING_SOCKET_ENCODING
- added tests and documentation
Original PR-URL: https://github.com/nodejs/node/pull/18178 (new pull request made due to git issues)
Because HTTP must be in US-ASCII, this function should either not be allowed, or should throw a standard stackTrace error
if invoked on an incoming packet.
Currently, the process encounters a fatal v8 error and crashes. error report detailed in: issue #18118
Ref: https://github.com/nodejs/node/pull/18178 Fixes: https://github.com/nodejs/node/issues/18118
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
_http_server
doc
errors
tests