http: deprecate instantiating classes without new

PR-URL: https://github.com/nodejs/node/pull/58518
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
This commit is contained in:
Yagiz Nizipli 2025-06-01 18:07:35 -04:00 committed by Antoine du Hamel
parent 6a56c68728
commit 597bfefbe1
No known key found for this signature in database
GPG Key ID: 21D900FFDB233756

View File

@ -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`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/58518
description: Documentation-only deprecation.
-->
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