File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -105,20 +105,18 @@ function createRequestExecutor(
105
105
return new Promise ( ( resolve , reject ) => {
106
106
let body = streamFromBody ( request . body ) ;
107
107
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 } ;
113
109
110
+ if ( request . body . length > GZIP_THRESHOLD ) {
111
+ headers [ 'content-encoding' ] = 'gzip' ;
114
112
body = body . pipe ( createGzip ( ) ) ;
115
113
}
116
114
117
115
const req = httpModule . request (
118
116
{
119
117
method : 'POST' ,
120
118
agent,
121
- headers : options . headers ,
119
+ headers,
122
120
hostname,
123
121
path : `${ pathname } ${ search } ` ,
124
122
port,
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ function setupTestServer(
42
42
43
43
const stream = req . headers [ 'content-encoding' ] === 'gzip' ? req . pipe ( createGunzip ( { } ) ) : req ;
44
44
45
- stream . on ( 'error' , ( ) => { } ) ;
46
-
47
45
stream . on ( 'data' , data => {
48
46
chunks . push ( data ) ;
49
47
} ) ;
You can’t perform that action at this time.
0 commit comments