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

Commit

Permalink
http: rename flush to flushHeaders
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tjfontaine committed Jan 16, 2015
1 parent efe1781 commit 89f3c90
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/api/http.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because
the request contained 'Expect: 100-continue'. This is an instruction that
the client should send the request body.

### request.flush()
### request.flushHeaders()

Flush the request headers.

Expand Down
2 changes: 1 addition & 1 deletion lib/_http_outgoing.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ OutgoingMessage.prototype._flush = function() {
};


OutgoingMessage.prototype.flush = function() {
OutgoingMessage.prototype.flushHeaders = function outgoingFlushHeaders() {
if (!this._header) {
// Force-flush the headers.
this._implicitHeader();
Expand Down
4 changes: 2 additions & 2 deletions test/simple/test-http-flush.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ http.createServer(function(req, res) {
host: '127.0.0.1',
port: common.PORT,
});
req.flush(); // Flush the request headers.
req.flush(); // Should be idempotent.
req.flushHeaders(); // Flush the request headers.
req.flushHeaders(); // Should be idempotent.
});

0 comments on commit 89f3c90

Please sign in to comment.