From 485d53e3af76fdcc67b93f49b057c8374c1e3595 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Thu, 2 Jan 2020 13:13:19 -0800 Subject: [PATCH 1/2] http: move OutboundMessage.prototype.flush to EOL API was deprecated long ago. Move to end of life and remove. --- 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 f6fec7d1ba0f61..022145529da307 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 c1f277da3fff57..580eafad96085a 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -893,10 +893,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. -}); From c3abba880da60db18d7208c74a741f95b3df2a9c Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 3 Feb 2020 21:08:25 -0800 Subject: [PATCH 2/2] [Squash] nit --- doc/api/deprecations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 022145529da307..68e427b99cae06 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -45,8 +45,8 @@ However, the deprecation identifier will not be modified.