mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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.
|
||||
});
|
||||
Reference in New Issue
Block a user