Skip to content

Commit

Permalink
fix: temporarily disable gzipping until axios bug fix is released
Browse files Browse the repository at this point in the history
  • Loading branch information
dpopp07 authored May 21, 2019
1 parent fdfbf14 commit b26a310
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion lib/requestwrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,11 @@ export function sendRequest(parameters, _callback) {
headers = extend(true, {}, headers, multipartForm.getHeaders());
}

// TEMPORARY: Disabling gzipping due to bug in axios until fix is released:
// https://github.com/axios/axios/pull/1129

// accept gzip encoded responses if Accept-Encoding is not already set
headers['Accept-Encoding'] = headers['Accept-Encoding'] || 'gzip';
// headers['Accept-Encoding'] = headers['Accept-Encoding'] || 'gzip';

const requestParams = {
url,
Expand Down
6 changes: 3 additions & 3 deletions test/unit/requestWrapper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('sendRequest', () => {
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
);
expect(axios.mock.calls[0][0].headers).toEqual({
'Accept-Encoding': 'gzip',
// 'Accept-Encoding': 'gzip',
'test-header': 'test-header-value',
});
expect(axios.mock.calls[0][0].httpsAgent.options.rejectUnauthorized).toEqual(
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('sendRequest', () => {
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
);
expect(axios.mock.calls[0][0].headers).toEqual({
'Accept-Encoding': 'gzip',
// 'Accept-Encoding': 'gzip',
'test-header': 'override-header-value',
'add-header': 'add-header-value',
});
Expand Down Expand Up @@ -207,7 +207,7 @@ describe('sendRequest', () => {
'https://example.ibm.com/v1/environments/environment-id/configurations/configuration-id'
);
expect(axios.mock.calls[0][0].headers).toMatchObject({
'Accept-Encoding': 'gzip',
// 'Accept-Encoding': 'gzip',
'test-header': 'override-header-value',
'add-header': 'add-header-value',
});
Expand Down

0 comments on commit b26a310

Please sign in to comment.