From f6d1fb71b5e107ef4a6e3b5d5dfa2a80ec3f30a5 Mon Sep 17 00:00:00 2001 From: Szymon Marczak <36894700+szmarczak@users.noreply.github.com> Date: Fri, 22 Oct 2021 15:02:49 +0200 Subject: [PATCH] Downgrade decompress-response --- benchmark/index.ts | 4 +++- package.json | 4 ++-- test/stream.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/benchmark/index.ts b/benchmark/index.ts index 2e059800d..87ccf445d 100644 --- a/benchmark/index.ts +++ b/benchmark/index.ts @@ -142,7 +142,9 @@ suite.add('got - promise', { }).add('axios - stream', { defer: true, fn: async (deferred: {resolve: () => void}) => { - const {data} = await axios.request(axiosStreamOptions); + const result = await axios.request(axiosStreamOptions); + const {data}: any = result; + data.resume(); data.once('end', () => { deferred.resolve(); diff --git a/package.json b/package.json index d3929fe6d..25b5425b7 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "@types/responselike": "^1.0.0", "cacheable-lookup": "^6.0.4", "cacheable-request": "^7.0.2", - "decompress-response": "^7.0.0", + "decompress-response": "^6.0.0", "form-data-encoder": "^1.6.0", "get-stream": "^6.0.1", "http2-wrapper": "^2.1.9", @@ -65,7 +65,7 @@ "@types/benchmark": "^2.1.1", "@types/express": "^4.17.13", "@types/node": "^16.11.3", - "@types/node-fetch": "^3.0.3", + "@types/node-fetch": "^2.5.12", "@types/pem": "^1.9.6", "@types/pify": "^5.0.1", "@types/readable-stream": "^2.3.11", diff --git a/test/stream.ts b/test/stream.ts index 9792772b2..bacf042ad 100644 --- a/test/stream.ts +++ b/test/stream.ts @@ -285,7 +285,7 @@ test('proxies `content-encoding` header when `options.decompress` is false', wit ); }); - const {headers} = await got('proxy'); + const {headers} = await got('proxy', {decompress: false}); t.is(headers.unicorn, 'rainbow'); t.is(headers['content-encoding'], 'gzip'); });