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