Skip to content

Commit 597bfef

Browse files
anonrigaduh95
authored andcommitted
http: deprecate instantiating classes without new
PR-URL: #58518 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Dario Piotrowicz <[email protected]>
1 parent 6a56c68 commit 597bfef

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
@@ -3809,6 +3809,21 @@ Type: Documentation-only
38093809
The support for priority signaling has been deprecated in the [RFC 9113][], and
38103810
will be removed in future versions of Node.js.
38113811

3812+
### DEP0195: Instantiating `node:http` classes without `new`
3813+
3814+
<!-- YAML
3815+
changes:
3816+
- version: REPLACEME
3817+
pr-url: https://github.com/nodejs/node/pull/58518
3818+
description: Documentation-only deprecation.
3819+
-->
3820+
3821+
Type: Documentation-only
3822+
3823+
Instantiating classes without the `new` qualifier exported by the `node:http` module is deprecated.
3824+
It is recommended to use the `new` qualifier instead. This applies to all http classes, such as
3825+
`OutgoingMessage`, `IncomingMessage`, `ServerResponse` and `ClientRequest`.
3826+
38123827
[DEP0142]: #dep0142-repl_builtinlibs
38133828
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
38143829
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

0 commit comments

Comments
 (0)