Skip to content

Commit 0e157b6

Browse files
authored
http: deprecate instantiating classes without new
PR-URL: #58518 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Dario Piotrowicz <dario.piotrowicz@gmail.com>
1 parent d89657c commit 0e157b6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/api/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,6 +3955,21 @@ Type: Documentation-only
39553955
The support for priority signaling has been deprecated in the [RFC 9113][], and
39563956
will be removed in future versions of Node.js.
39573957

3958+
### DEP0195: Instantiating `node:http` classes without `new`
3959+
3960+
<!-- YAML
3961+
changes:
3962+
- version: REPLACEME
3963+
pr-url: https://github.com/nodejs/node/pull/58518
3964+
description: Documentation-only deprecation.
3965+
-->
3966+
3967+
Type: Documentation-only
3968+
3969+
Instantiating classes without the `new` qualifier exported by the `node:http` module is deprecated.
3970+
It is recommended to use the `new` qualifier instead. This applies to all http classes, such as
3971+
`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`.
3972+
39583973
[DEP0142]: #dep0142-repl_builtinlibs
39593974
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
39603975
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

0 commit comments

Comments
 (0)