Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 89f3c90

Browse files
committed
http: rename flush to flushHeaders
In order to preserve the potential for a flush method being added to the streams API, rename flush to flushHeaders which is much more clear about the behavior of this method. PR: #9048 PR-URL: #9048 Reviewed-By: Julien Gilli <[email protected]>
1 parent efe1781 commit 89f3c90

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

doc/api/http.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because
855855
the request contained 'Expect: 100-continue'. This is an instruction that
856856
the client should send the request body.
857857

858-
### request.flush()
858+
### request.flushHeaders()
859859

860860
Flush the request headers.
861861

lib/_http_outgoing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ OutgoingMessage.prototype._flush = function() {
613613
};
614614

615615

616-
OutgoingMessage.prototype.flush = function() {
616+
OutgoingMessage.prototype.flushHeaders = function outgoingFlushHeaders() {
617617
if (!this._header) {
618618
// Force-flush the headers.
619619
this._implicitHeader();

test/simple/test-http-flush.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ http.createServer(function(req, res) {
3232
host: '127.0.0.1',
3333
port: common.PORT,
3434
});
35-
req.flush(); // Flush the request headers.
36-
req.flush(); // Should be idempotent.
35+
req.flushHeaders(); // Flush the request headers.
36+
req.flushHeaders(); // Should be idempotent.
3737
});

0 commit comments

Comments
 (0)