@@ -2767,6 +2767,28 @@ These properties are now available within the standard `detail` property
2767
2767
of the ` PerformanceEntry ` object. The existing accessors have been
2768
2768
deprecated and should no longer be used.
2769
2769
2770
+ ### DEP0XXX: ` .aborted ` property and ` 'abort' ` , ` 'aborted' ` event in ` http `
2771
+ <!-- YAML
2772
+ changes:
2773
+ - version: REPLACEME
2774
+ pr-url: https://github.com/nodejs/node/pull/36670
2775
+ description: Documentation-only deprecation.
2776
+ -->
2777
+
2778
+ Type: Documentation-only
2779
+
2780
+ Move to {Stream} API instead, as the [ ` http.ClientRequest ` ] [ ] ,
2781
+ [ ` http.ServerResponse ` ] [ ] , and [ ` http.IncomingMessage ` ] [ ] are all stream-based.
2782
+ Check ` stream.destroyed ` instead of the ` .aborted ` property, and listen for
2783
+ ` 'close' ` instead of ` 'abort' ` , ` 'aborted' ` event.
2784
+
2785
+ The ` .aborted ` property and ` 'abort' ` event are only useful for detecting
2786
+ ` .abort() ` calls. For closing a request early, use the Stream
2787
+ ` .destroy([error]) ` then check the ` .destroyed ` property and ` 'close' ` event
2788
+ should have the same effect. The receiving end should also check the
2789
+ [ ` readable.readableEnded ` ] [ ] value on [ ` http.IncomingMessage ` ] [ ] to get whether
2790
+ it was an aborted or graceful destroy.
2791
+
2770
2792
[ Legacy URL API ] : url.md#url_legacy_url_api
2771
2793
[ NIST SP 800-38D ] : https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
2772
2794
[ RFC 6066 ] : https://tools.ietf.org/html/rfc6066#section-3
@@ -2822,6 +2844,9 @@ deprecated and should no longer be used.
2822
2844
[ `fs.read()` ] : fs.md#fs_fs_read_fd_buffer_offset_length_position_callback
2823
2845
[ `fs.readSync()` ] : fs.md#fs_fs_readsync_fd_buffer_offset_length_position
2824
2846
[ `fs.stat()` ] : fs.md#fs_fs_stat_path_options_callback
2847
+ [ `http.ClientRequest` ] : #http_class_http_clientrequest
2848
+ [ `http.IncomingMessage` ] : #http_class_http_incomingmessage
2849
+ [ `http.ServerResponse` ] : #http_class_http_serverresponse
2825
2850
[ `http.get()` ] : http.md#http_http_get_options_callback
2826
2851
[ `http.request()` ] : http.md#http_http_request_options_callback
2827
2852
[ `https.get()` ] : https.md#https_https_get_options_callback
@@ -2834,6 +2859,7 @@ deprecated and should no longer be used.
2834
2859
[ `process.env` ] : process.md#process_process_env
2835
2860
[ `process.mainModule` ] : process.md#process_process_mainmodule
2836
2861
[ `punycode` ] : punycode.md
2862
+ [ `readable.readableEnded` ] : stream.md#stream_readable_readableended
2837
2863
[ `request.abort()` ] : http.md#http_request_abort
2838
2864
[ `request.connection` ] : http.md#http_request_connection
2839
2865
[ `request.destroy()` ] : http.md#http_request_destroy_error
0 commit comments