@@ -2743,6 +2743,28 @@ Previously, `index.js` and extension searching lookups would apply to
2743
2743
With this deprecation, all ES module main entry point resolutions require
2744
2744
an explicit [ ` "exports" ` or ` "main" ` entry] [ ] with the exact file extension.
2745
2745
2746
+ ### DEP0XXX: ` .aborted ` property and ` 'abort' ` , ` 'aborted' ` event in ` http `
2747
+ <!-- YAML
2748
+ changes:
2749
+ - version: REPLACEME
2750
+ pr-url: https://github.com/nodejs/node/pull/36670
2751
+ description: Documentation-only deprecation.
2752
+ -->
2753
+
2754
+ Type: Documentation-only
2755
+
2756
+ Move to {Stream} API instead, as the [ ` http.ClientRequest ` ] [ ] ,
2757
+ [ ` http.ServerResponse ` ] [ ] , and [ ` http.IncomingMessage ` ] [ ] are all stream-based.
2758
+ Check ` stream.destroyed ` instead of the ` .aborted ` property, and listen for
2759
+ ` 'close' ` instead of ` 'abort' ` , ` 'aborted' ` event.
2760
+
2761
+ The ` .aborted ` property and ` 'abort' ` event are only useful for detecting
2762
+ ` .abort() ` calls. For closing a request early, use the Stream
2763
+ ` .destroy([error]) ` then check the ` .destroyed ` property and ` 'close' ` event
2764
+ should have the same effect. The receiving end should also check the
2765
+ [ ` readable.readableEnded ` ] [ ] value on [ ` http.IncomingMessage ` ] [ ] to get whether
2766
+ it was an aborted or graceful destroy.
2767
+
2746
2768
[ Legacy URL API ] : url.md#url_legacy_url_api
2747
2769
[ NIST SP 800-38D ] : https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
2748
2770
[ RFC 6066 ] : https://tools.ietf.org/html/rfc6066#section-3
@@ -2798,6 +2820,9 @@ an explicit [`"exports"` or `"main"` entry][] with the exact file extension.
2798
2820
[ `fs.read()` ] : fs.md#fs_fs_read_fd_buffer_offset_length_position_callback
2799
2821
[ `fs.readSync()` ] : fs.md#fs_fs_readsync_fd_buffer_offset_length_position
2800
2822
[ `fs.stat()` ] : fs.md#fs_fs_stat_path_options_callback
2823
+ [ `http.ClientRequest` ] : #http_class_http_clientrequest
2824
+ [ `http.IncomingMessage` ] : #http_class_http_incomingmessage
2825
+ [ `http.ServerResponse` ] : #http_class_http_serverresponse
2801
2826
[ `http.get()` ] : http.md#http_http_get_options_callback
2802
2827
[ `http.request()` ] : http.md#http_http_request_options_callback
2803
2828
[ `https.get()` ] : https.md#https_https_get_options_callback
@@ -2810,6 +2835,7 @@ an explicit [`"exports"` or `"main"` entry][] with the exact file extension.
2810
2835
[ `process.env` ] : process.md#process_process_env
2811
2836
[ `process.mainModule` ] : process.md#process_process_mainmodule
2812
2837
[ `punycode` ] : punycode.md
2838
+ [ `readable.readableEnded` ] : stream.md#stream_readable_readableended
2813
2839
[ `request.abort()` ] : http.md#http_request_abort
2814
2840
[ `request.connection` ] : http.md#http_request_connection
2815
2841
[ `request.destroy()` ] : http.md#http_request_destroy_error
0 commit comments