From 007246954b103e6812bbcc60e529d51ca816fa62 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 30 May 2025 17:56:58 -0400 Subject: [PATCH 1/2] http: deprecate instantiating classes without new --- doc/api/deprecations.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 1016c5df524f52..7efda827782308 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3949,6 +3949,22 @@ 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 From 8b8b2e792173a5f2a742f2df42e34194af1a0df9 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Fri, 30 May 2025 18:44:05 -0400 Subject: [PATCH 2/2] Update deprecations.md --- doc/api/deprecations.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 7efda827782308..b21afe5795f62f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3964,7 +3964,6 @@ Instantiating classes without the `new` qualifier exported by the `node:http` mo 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