@@ -38,7 +38,6 @@ const { getDefaultHighWaterMark } = require('internal/streams/state');
3838const assert = require ( 'internal/assert' ) ;
3939const EE = require ( 'events' ) ;
4040const Stream = require ( 'stream' ) ;
41- const internalUtil = require ( 'internal/util' ) ;
4241const { kOutHeaders, utcDate, kNeedDrain } = require ( 'internal/http' ) ;
4342const { Buffer } = require ( 'buffer' ) ;
4443const {
@@ -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- return this . getHeaders ( ) ;
218- } , 'OutgoingMessage.prototype._headers is deprecated' , 'DEP0066' ) ,
219- set : internalUtil . deprecate ( function ( val ) {
220- if ( val == null ) {
221- this [ kOutHeaders ] = null ;
222- } else if ( typeof val === 'object' ) {
223- const headers = this [ kOutHeaders ] = { __proto__ : null } ;
224- const keys = ObjectKeys ( val ) ;
225- // Retain for(;;) loop for performance reasons
226- // Refs: https://github.com/nodejs/node/pull/30958
227- for ( let i = 0 ; i < keys . length ; ++ i ) {
228- const name = keys [ i ] ;
229- headers [ name . toLowerCase ( ) ] = [ name , val [ name ] ] ;
230- }
231- }
232- } , 'OutgoingMessage.prototype._headers is deprecated' , 'DEP0066' ) ,
233- } ) ;
234-
235213ObjectDefineProperty ( 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- const headers = this [ kOutHeaders ] ;
263- if ( headers !== null ) {
264- const out = { __proto__ : null } ;
265- const keys = ObjectKeys ( headers ) ;
266- // Retain for(;;) loop for performance reasons
267- // Refs: https://github.com/nodejs/node/pull/30958
268- for ( let i = 0 ; i < keys . length ; ++ i ) {
269- const key = keys [ i ] ;
270- const val = headers [ key ] [ 0 ] ;
271- out [ key ] = val ;
272- }
273- return out ;
274- }
275- return null ;
276- } , 'OutgoingMessage.prototype._headerNames is deprecated' , 'DEP0066' ) ,
277- set : internalUtil . deprecate ( function ( val ) {
278- if ( typeof val === 'object' && val !== null ) {
279- const headers = this [ kOutHeaders ] ;
280- if ( ! headers )
281- return ;
282- const keys = ObjectKeys ( val ) ;
283- // Retain for(;;) loop for performance reasons
284- // Refs: https://github.com/nodejs/node/pull/30958
285- for ( let i = 0 ; i < keys . length ; ++ i ) {
286- const header = headers [ keys [ i ] ] ;
287- if ( header )
288- header [ 0 ] = val [ keys [ i ] ] ;
289- }
290- }
291- } , 'OutgoingMessage.prototype._headerNames is deprecated' , 'DEP0066' ) ,
292- } ) ;
293-
294-
295237OutgoingMessage . prototype . _renderHeaders = function _renderHeaders ( ) {
296238 if ( this . _header ) {
297239 throw new ERR_HTTP_HEADERS_SENT ( 'render' ) ;
0 commit comments