Skip to content

Commit b26a310

Browse files
authored
fix: temporarily disable gzipping until axios bug fix is released
1 parent fdfbf14 commit b26a310

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/requestwrapper.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,11 @@ export function sendRequest(parameters, _callback) {
269269
headers = extend(true, {}, headers, multipartForm.getHeaders());
270270
}
271271

272+
// TEMPORARY: Disabling gzipping due to bug in axios until fix is released:
273+
// https://github.com/axios/axios/pull/1129
274+
272275
// accept gzip encoded responses if Accept-Encoding is not already set
273-
headers['Accept-Encoding'] = headers['Accept-Encoding'] || 'gzip';
276+
// headers['Accept-Encoding'] = headers['Accept-Encoding'] || 'gzip';
274277

275278
const requestParams = {
276279
url,

test/unit/requestWrapper.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('sendRequest', () => {
4545
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
4646
);
4747
expect(axios.mock.calls[0][0].headers).toEqual({
48-
'Accept-Encoding': 'gzip',
48+
// 'Accept-Encoding': 'gzip',
4949
'test-header': 'test-header-value',
5050
});
5151
expect(axios.mock.calls[0][0].httpsAgent.options.rejectUnauthorized).toEqual(
@@ -134,7 +134,7 @@ describe('sendRequest', () => {
134134
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
135135
);
136136
expect(axios.mock.calls[0][0].headers).toEqual({
137-
'Accept-Encoding': 'gzip',
137+
// 'Accept-Encoding': 'gzip',
138138
'test-header': 'override-header-value',
139139
'add-header': 'add-header-value',
140140
});
@@ -207,7 +207,7 @@ describe('sendRequest', () => {
207207
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
208208
);
209209
expect(axios.mock.calls[0][0].headers).toMatchObject({
210-
'Accept-Encoding': 'gzip',
210+
// 'Accept-Encoding': 'gzip',
211211
'test-header': 'override-header-value',
212212
'add-header': 'add-header-value',
213213
});

0 commit comments

Comments
 (0)