From 597bfefbe1941f79cef958a698e90e2975bee8f5 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sun, 1 Jun 2025 18:07:35 -0400 Subject: [PATCH] http: deprecate instantiating classes without new PR-URL: https://github.com/nodejs/node/pull/58518 Reviewed-By: Stephen Belanger Reviewed-By: James M Snell Reviewed-By: Dario Piotrowicz --- doc/api/deprecations.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index dd1ec3edea0..96c8fa4debc 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3809,6 +3809,21 @@ Type: Documentation-only The support for priority signaling has been deprecated in the [RFC 9113][], and will be removed in future versions of Node.js. +### DEP0195: Instantiating `node:http` classes without `new` + + + +Type: Documentation-only + +Instantiating classes without the `new` qualifier exported by the `node:http` module is deprecated. +It is recommended to use the `new` qualifier instead. This applies to all http classes, such as +`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`. + [DEP0142]: #dep0142-repl_builtinlibs [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3