Fix http socket encoding check (#20031)

Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2025-05-29 17:05:51 -07:00
committed by GitHub
parent 9f5adfefe3
commit f5bfda9699
2 changed files with 32 additions and 0 deletions

View File

@@ -1408,6 +1408,12 @@ const NodeHTTPServerSocket = class Socket extends Duplex {
return this;
}
setEncoding(_encoding) {
const err = new Error("Changing the socket encoding is not allowed per RFC7230 Section 3.");
err.code = "ERR_HTTP_SOCKET_ENCODING";
throw err;
}
unref() {
return this;
}