@@ -10,6 +10,7 @@ import https = require('https');
10
10
import timer , { ClientRequestWithTimings , Timings , IncomingMessageWithTimings } from '@szmarczak/http-timer' ;
11
11
import CacheableLookup from 'cacheable-lookup' ;
12
12
import CacheableRequest = require( 'cacheable-request' ) ;
13
+ import decompressResponse = require( 'decompress-response' ) ;
13
14
// @ts -ignore Missing types
14
15
import http2wrapper = require( 'http2-wrapper' ) ;
15
16
import lowercaseKeys = require( 'lowercase-keys' ) ;
@@ -23,7 +24,6 @@ import timedOut, {Delays, TimeoutError as TimedOutTimeoutError} from './utils/ti
23
24
import urlToOptions from './utils/url-to-options' ;
24
25
import optionsToUrl , { URLOptions } from './utils/options-to-url' ;
25
26
import WeakableMap from './utils/weakable-map' ;
26
- import decompressResponse from './utils/decompress-response' ;
27
27
28
28
type HttpRequestFunction = typeof httpRequest ;
29
29
type Error = NodeJS . ErrnoException ;
@@ -1234,6 +1234,9 @@ export default class Request extends Duplex implements RequestEvents<Request> {
1234
1234
const typedResponse = response as unknown as IncomingMessage & { req : ClientRequest } ;
1235
1235
const { req} = typedResponse ;
1236
1236
1237
+ // TODO: Fix `cacheable-response`
Has a conversation. Original line has a conversation.
1238
+ ( typedResponse as any ) . _readableState . autoDestroy = false ;
1239
+
1237
1240
if ( req ) {
1238
1241
req . emit ( 'cacheableResponse' , typedResponse ) ;
1239
1242
}