Skip to content

http: setEncoding error for incoming packets

added wrapping on socket.setEncoding to not allow encoding changes on incoming packets.

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

Fixes: https://github.com/nodejs/node/issues/18118

Ref: #19344

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)
  • _http_server (specifically: connectionListenerInternal method -> socket variable)

Merge request reports

Loading