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