From d3715c76b5c287d900d28f472da0186322ace811 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 2 Jan 2020 13:13:19 -0800 Subject: [PATCH] http: move OutboundMessage.prototype.flush to EOL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Ruben Bridgewater Reviewed-By: Sam Roberts Reviewed-By: Tobias Nießen Reviewed-By: Matteo Collina Reviewed-By: Michael Dawson --- doc/api/deprecations.md | 7 ++++-- lib/_http_outgoing.js | 4 ---- test/parallel/test-http-flush.js | 37 -------------------------------- 3 files changed, 5 insertions(+), 43 deletions(-) delete mode 100644 test/parallel/test-http-flush.js diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 0deb79a05fefd5..075a620b403407 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -44,6 +44,9 @@ However, the deprecation identifier will not be modified. ### DEP0001: `http.OutgoingMessage.prototype.flush` -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. diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index b8ee0b67689003..0230f4283112c3 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -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()); diff --git a/test/parallel/test-http-flush.js b/test/parallel/test-http-flush.js deleted file mode 100644 index 24f43d5efecfa4..00000000000000 --- a/test/parallel/test-http-flush.js +++ /dev/null @@ -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. -});