@@ -2827,6 +2827,28 @@ Type: Documentation-only (supports [`--pending-deprecation`][])
2827
2827
The remapping of specifiers ending in ` "/" ` like ` import 'pkg/x/' ` is deprecated
2828
2828
for package ` "exports" ` and ` "imports" ` pattern resolutions.
2829
2829
2830
+ ### DEP0XXX: ` .aborted ` property and ` 'abort' ` , ` 'aborted' ` event in ` http `
2831
+ <!-- YAML
2832
+ changes:
2833
+ - version: REPLACEME
2834
+ pr-url: https://github.com/nodejs/node/pull/36670
2835
+ description: Documentation-only deprecation.
2836
+ -->
2837
+
2838
+ Type: Documentation-only
2839
+
2840
+ Move to {Stream} API instead, as the [ ` http.ClientRequest ` ] [ ] ,
2841
+ [ ` http.ServerResponse ` ] [ ] , and [ ` http.IncomingMessage ` ] [ ] are all stream-based.
2842
+ Check ` stream.destroyed ` instead of the ` .aborted ` property, and listen for
2843
+ ` 'close' ` instead of ` 'abort' ` , ` 'aborted' ` event.
2844
+
2845
+ The ` .aborted ` property and ` 'abort' ` event are only useful for detecting
2846
+ ` .abort() ` calls. For closing a request early, use the Stream
2847
+ ` .destroy([error]) ` then check the ` .destroyed ` property and ` 'close' ` event
2848
+ should have the same effect. The receiving end should also check the
2849
+ [ ` readable.readableEnded ` ] [ ] value on [ ` http.IncomingMessage ` ] [ ] to get whether
2850
+ it was an aborted or graceful destroy.
2851
+
2830
2852
[ Legacy URL API ] : url.md#legacy-url-api
2831
2853
[ NIST SP 800-38D ] : https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
2832
2854
[ RFC 6066 ] : https://tools.ietf.org/html/rfc6066#section-3
@@ -2884,6 +2906,9 @@ for package `"exports"` and `"imports"` pattern resolutions.
2884
2906
[ `fs.read()` ] : fs.md#fsreadfd-buffer-offset-length-position-callback
2885
2907
[ `fs.readSync()` ] : fs.md#fsreadsyncfd-buffer-offset-length-position
2886
2908
[ `fs.stat()` ] : fs.md#fsstatpath-options-callback
2909
+ [ `http.ClientRequest` ] : http.md#class-httpclientrequest
2910
+ [ `http.IncomingMessage` ] : http.md#class-httpincomingmessage
2911
+ [ `http.ServerResponse` ] : http.md#class-httpserverresponse
2887
2912
[ `http.get()` ] : http.md#httpgetoptions-callback
2888
2913
[ `http.request()` ] : http.md#httprequestoptions-callback
2889
2914
[ `https.get()` ] : https.md#httpsgetoptions-callback
@@ -2896,6 +2921,7 @@ for package `"exports"` and `"imports"` pattern resolutions.
2896
2921
[ `process.env` ] : process.md#processenv
2897
2922
[ `process.mainModule` ] : process.md#processmainmodule
2898
2923
[ `punycode` ] : punycode.md
2924
+ [ `readable.readableEnded` ] : stream.md#readablereadableended
2899
2925
[ `request.abort()` ] : http.md#requestabort
2900
2926
[ `request.connection` ] : http.md#requestconnection
2901
2927
[ `request.destroy()` ] : http.md#requestdestroyerror
0 commit comments