Skip to content

Commit 7d4db69

Browse files
anonrigRafaelGSS
authored andcommitted
http: remove outgoingmessage _headers and _headersList
PR-URL: #57551 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tim Perry <pimterry@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
1 parent eaec2b5 commit 7d4db69

5 files changed

Lines changed: 4 additions & 141 deletions

‎doc/api/deprecations.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,9 @@ removed. Please use `sloppy` instead.
15451545

15461546
<!-- YAML
15471547
changes:
1548+
- version: REPLACEME
1549+
pr-url: https://github.com/nodejs/node/pull/57551
1550+
description: End-of-Life.
15481551
- version: v12.0.0
15491552
pr-url: https://github.com/nodejs/node/pull/24167
15501553
description: Runtime deprecation.
@@ -1553,7 +1556,7 @@ changes:
15531556
description: Documentation-only deprecation.
15541557
-->
15551558

1556-
Type: Runtime
1559+
Type: End-of-Life
15571560

15581561
The `node:http` module `OutgoingMessage.prototype._headers` and
15591562
`OutgoingMessage.prototype._headerNames` properties are deprecated. Use one of

‎lib/_http_outgoing.js‎

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const { getDefaultHighWaterMark } = require('internal/streams/state');
3838
constassert=require('internal/assert');
3939
constEE=require('events');
4040
constStream=require('stream');
41-
constinternalUtil=require('internal/util');
4241
const{ kOutHeaders, utcDate, kNeedDrain }=require('internal/http');
4342
const{ Buffer }=require('buffer');
4443
const{
@@ -211,27 +210,6 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'writableCorked', {
211210
},
212211
});
213212

214-
ObjectDefineProperty(OutgoingMessage.prototype,'_headers',{
215-
__proto__: null,
216-
get: internalUtil.deprecate(function(){
217-
returnthis.getHeaders();
218-
},'OutgoingMessage.prototype._headers is deprecated','DEP0066'),
219-
set: internalUtil.deprecate(function(val){
220-
if(val==null){
221-
this[kOutHeaders]=null;
222-
}elseif(typeofval==='object'){
223-
constheaders=this[kOutHeaders]={__proto__: null};
224-
constkeys=ObjectKeys(val);
225-
// Retain for(;;) loop for performance reasons
226-
// Refs: https://github.com/nodejs/node/pull/30958
227-
for(leti=0;i<keys.length;++i){
228-
constname=keys[i];
229-
headers[name.toLowerCase()]=[name,val[name]];
230-
}
231-
}
232-
},'OutgoingMessage.prototype._headers is deprecated','DEP0066'),
233-
});
234-
235213
ObjectDefineProperty(OutgoingMessage.prototype,'connection',{
236214
__proto__: null,
237215
get: function(){
@@ -256,42 +234,6 @@ ObjectDefineProperty(OutgoingMessage.prototype, 'socket', {
256234
},
257235
});
258236

259-
ObjectDefineProperty(OutgoingMessage.prototype,'_headerNames',{
260-
__proto__: null,
261-
get: internalUtil.deprecate(function(){
262-
constheaders=this[kOutHeaders];
263-
if(headers!==null){
264-
constout={__proto__: null};
265-
constkeys=ObjectKeys(headers);
266-
// Retain for(;;) loop for performance reasons
267-
// Refs: https://github.com/nodejs/node/pull/30958
268-
for(leti=0;i<keys.length;++i){
269-
constkey=keys[i];
270-
constval=headers[key][0];
271-
out[key]=val;
272-
}
273-
returnout;
274-
}
275-
returnnull;
276-
},'OutgoingMessage.prototype._headerNames is deprecated','DEP0066'),
277-
set: internalUtil.deprecate(function(val){
278-
if(typeofval==='object'&&val!==null){
279-
constheaders=this[kOutHeaders];
280-
if(!headers)
281-
return;
282-
constkeys=ObjectKeys(val);
283-
// Retain for(;;) loop for performance reasons
284-
// Refs: https://github.com/nodejs/node/pull/30958
285-
for(leti=0;i<keys.length;++i){
286-
constheader=headers[keys[i]];
287-
if(header)
288-
header[0]=val[keys[i]];
289-
}
290-
}
291-
},'OutgoingMessage.prototype._headerNames is deprecated','DEP0066'),
292-
});
293-
294-
295237
OutgoingMessage.prototype._renderHeaders=function_renderHeaders(){
296238
if(this._header){
297239
thrownewERR_HTTP_HEADERS_SENT('render');

‎test/parallel/test-http-outgoing-internal-headernames-getter.js‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎test/parallel/test-http-outgoing-internal-headernames-setter.js‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎test/parallel/test-http-outgoing-internal-headers.js‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)