diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 46d2467c7234b8..bcaa8eaec6db6f 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2518,6 +2518,27 @@ Type: Documentation-only Prefer [`response.socket`][] over [`response.connection`] and [`request.socket`][] over [`request.connection`]. + +### DEP0XXX: http/2 request.finished and response.finished + + +Type: Documentation-only + +[`response.finished`][] indicates whether [`response.end()`][] has been +called, not whether `'finish'` has been emitted and the underlying data +is flushed. + +Use [`response.writableFinished`][] or [`response.writableEnded`][] +accordingly instead to avoid the ambigiuty. + +To maintain existing behaviour `response.finished` should be replaced with +`response.writableEnded`. + [`--pending-deprecation`]: cli.html#cli_pending_deprecation [`--throw-deprecation`]: cli.html#cli_throw_deprecation [`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size @@ -2576,6 +2597,10 @@ Prefer [`response.socket`][] over [`response.connection`] and [`request.connection`]: http.html#http_request_connection [`response.socket`]: http.html#http_response_socket [`response.connection`]: http.html#http_response_connection +[`response.end()`]: http.html#http_response_end_data_encoding_callback +[`response.finished`]: #http_response_finished +[`response.writableFinished`]: #http_response_writablefinished +[`response.writableEnded`]: #http_response_writableended [`script.createCachedData()`]: vm.html#vm_script_createcacheddata [`setInterval()`]: timers.html#timers_setinterval_callback_delay_args [`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args diff --git a/doc/api/http.md b/doc/api/http.md index 10f68cab4c3fc1..0d2aee5064ebd7 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -603,8 +603,11 @@ is finished. ### request.finished +> Stability: 0 - Deprecated. Use [`request.writableEnded`][]. + * {boolean} The `request.finished` property will be `true` if [`request.end()`][] @@ -1202,8 +1205,11 @@ is finished. ### response.finished +> Stability: 0 - Deprecated. Use [`response.writableEnded`][]. + * {boolean} The `response.finished` property will be `true` if [`response.end()`][] @@ -2258,12 +2264,14 @@ not abort the request or do anything besides add a `'timeout'` event. [`request.socket.getPeerCertificate()`]: tls.html#tls_tlssocket_getpeercertificate_detailed [`request.socket`]: #http_request_socket [`request.writableFinished`]: #http_request_writablefinished +[`request.writableEnded`]: #http_request_writableended [`request.write(data, encoding)`]: #http_request_write_chunk_encoding_callback [`response.end()`]: #http_response_end_data_encoding_callback [`response.getHeader()`]: #http_response_getheader_name [`response.setHeader()`]: #http_response_setheader_name_value [`response.socket`]: #http_response_socket [`response.writableFinished`]: #http_response_writablefinished +[`response.writableEnded`]: #http_response_writableended [`response.write()`]: #http_response_write_chunk_encoding_callback [`response.write(data, encoding)`]: #http_response_write_chunk_encoding_callback [`response.writeContinue()`]: #http_response_writecontinue diff --git a/doc/api/http2.md b/doc/api/http2.md index 494a7d8212f79e..78865e9be8d0b3 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -3033,8 +3033,11 @@ is finished. #### response.finished +> Stability: 0 - Deprecated. Use [`response.writableEnded`][]. + * {boolean} Boolean value that indicates whether the response has completed. Starts @@ -3517,6 +3520,7 @@ following additional properties: [`response.end()`]: #http2_response_end_data_encoding_callback [`response.setHeader()`]: #http2_response_setheader_name_value [`response.socket`]: #http2_response_socket +[`response.writableEnded`]: #http2_response_writableended [`response.write()`]: #http2_response_write_chunk_encoding_callback [`response.write(data, encoding)`]: http.html#http_response_write_chunk_encoding_callback [`response.writeContinue()`]: #http2_response_writecontinue