Skip to content

Commit 0072469

Browse files
committed
http: deprecate instantiating classes without new
1 parent dd205c9 commit 0072469

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3949,6 +3949,22 @@ Type: Documentation-only
39493949
The support for priority signaling has been deprecated in the [RFC 9113][], and
39503950
will be removed in future versions of Node.js.
39513951

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

0 commit comments

Comments
 (0)