http: move OutboundMessage.prototype.flush to EOL

API was deprecated long ago. Move to end of life and remove.

PR-URL: https://github.com/nodejs/node/pull/31164
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
James M Snell
2020-01-02 13:13:19 -08:00
parent e68d4c6f5f
commit d3715c76b5
3 changed files with 5 additions and 43 deletions

View File

@@ -44,6 +44,9 @@ However, the deprecation identifier will not be modified.
### DEP0001: `http.OutgoingMessage.prototype.flush`
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/31164
description: End-of-Life.
- version:
- v4.8.6
- v6.12.0
@@ -54,9 +57,9 @@ changes:
description: Runtime deprecation.
-->
Type: Runtime
Type: End-of-Life
The `OutgoingMessage.prototype.flush()` method is deprecated. Use
`OutgoingMessage.prototype.flush()` has been removed. Use
`OutgoingMessage.prototype.flushHeaders()` instead.
<a id="DEP0002"></a>

View File

@@ -900,10 +900,6 @@ OutgoingMessage.prototype.flushHeaders = function flushHeaders() {
this._send('');
};
OutgoingMessage.prototype.flush = internalUtil.deprecate(function() {
this.flushHeaders();
}, 'OutgoingMessage.flush is deprecated. Use flushHeaders instead.', 'DEP0001');
OutgoingMessage.prototype.pipe = function pipe() {
// OutgoingMessage should be write-only. Piping from it is disabled.
this.emit('error', new ERR_STREAM_CANNOT_PIPE());

View File

@@ -1,37 +0,0 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
require('../common');
const http = require('http');
http.createServer(function(req, res) {
res.end('ok');
this.close();
}).listen(0, '127.0.0.1', function() {
const req = http.request({
method: 'POST',
host: '127.0.0.1',
port: this.address().port,
});
req.flush(); // Flush the request headers.
req.flush(); // Should be idempotent.
});