Skip to content

Commit c2bc014

Browse files
committedMay 15, 2020
Upgrade decompress-response to 6.0.0
1 parent 761b8e0 commit c2bc014

File tree

3 files changed

+5
-100
lines changed

3 files changed

+5
-100
lines changed
 

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@types/responselike": "^1.0.0",
5050
"cacheable-lookup": "^5.0.3",
5151
"cacheable-request": "^7.0.1",
52+
"decompress-response": "^6.0.0",
5253
"get-stream": "^5.1.0",
5354
"http2-wrapper": "^1.0.0-beta.4.5",
5455
"lowercase-keys": "^2.0.0",

‎source/core/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import https = require('https');
1010
import timer, {ClientRequestWithTimings, Timings, IncomingMessageWithTimings} from '@szmarczak/http-timer';
1111
import CacheableLookup from 'cacheable-lookup';
1212
import CacheableRequest = require('cacheable-request');
13+
import decompressResponse = require('decompress-response');
1314
// @ts-ignore Missing types
1415
import http2wrapper = require('http2-wrapper');
1516
import lowercaseKeys = require('lowercase-keys');
@@ -23,7 +24,6 @@ import timedOut, {Delays, TimeoutError as TimedOutTimeoutError} from './utils/ti
2324
import urlToOptions from './utils/url-to-options';
2425
import optionsToUrl, {URLOptions} from './utils/options-to-url';
2526
import WeakableMap from './utils/weakable-map';
26-
import decompressResponse from './utils/decompress-response';
2727

2828
type HttpRequestFunction = typeof httpRequest;
2929
type Error = NodeJS.ErrnoException;
@@ -1234,6 +1234,9 @@ export default class Request extends Duplex implements RequestEvents<Request> {
12341234
const typedResponse = response as unknown as IncomingMessage & {req: ClientRequest};
12351235
const {req} = typedResponse;
12361236

1237+
// TODO: Fix `cacheable-response`
Has a conversation. Original line has a conversation.
1238+
(typedResponse as any)._readableState.autoDestroy = false;
1239+
12371240
if (req) {
12381241
req.emit('cacheableResponse', typedResponse);
12391242
}

‎source/core/utils/decompress-response.ts

-99
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.