File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -105,20 +105,18 @@ function createRequestExecutor(
105105 return new Promise ( ( resolve , reject ) => {
106106 let body = streamFromBody ( request . body ) ;
107107
108- if ( request . body . length > GZIP_THRESHOLD ) {
109- options . headers = {
110- ...options . headers ,
111- 'content-encoding' : 'gzip' ,
112- } ;
108+ const headers : Record < string , string > = { ...options . headers } ;
113109
110+ if ( request . body . length > GZIP_THRESHOLD ) {
111+ headers [ 'content-encoding' ] = 'gzip' ;
114112 body = body . pipe ( createGzip ( ) ) ;
115113 }
116114
117115 const req = httpModule . request (
118116 {
119117 method : 'POST' ,
120118 agent,
121- headers : options . headers ,
119+ headers,
122120 hostname,
123121 path : `${ pathname } ${ search } ` ,
124122 port,
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ function setupTestServer(
4242
4343 const stream = req . headers [ 'content-encoding' ] === 'gzip' ? req . pipe ( createGunzip ( { } ) ) : req ;
4444
45- stream . on ( 'error' , ( ) => { } ) ;
46-
4745 stream . on ( 'data' , data => {
4846 chunks . push ( data ) ;
4947 } ) ;
You can’t perform that action at this time.
0 commit comments