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

http: rename flush to flushHeaders #9048

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
});