Skip to content

Commit

Permalink
Revert "Adding gzip headers to reduce payload sizes and enable compre…
Browse files Browse the repository at this point in the history
…ssion (#…"

This reverts commit 214cb58.
  • Loading branch information
SubashPradhan authored Oct 30, 2024
1 parent 5ef4b13 commit 68d41f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
1 change: 0 additions & 1 deletion src/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export default class APIClient {
objKeysToSnakeCase(optionParams.body, ['metadata']) // metadata should remain as is
);
requestOptions.headers['Content-Type'] = 'application/json';
requestOptions.headers['Accept-Encoding'] = 'gzip';
}

if (optionParams.form) {
Expand Down
13 changes: 1 addition & 12 deletions tests/apiClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('APIClient', () => {
timeout: 30,
headers: {
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
},
});

Expand All @@ -29,7 +28,6 @@ describe('APIClient', () => {
expect(client.timeout).toBe(30000);
expect(client.headers).toEqual({
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
});
});
});
Expand All @@ -51,10 +49,7 @@ describe('APIClient', () => {
const options = client.requestOptions({
path: '/test',
method: 'GET',
headers: {
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
},
headers: { 'X-SDK-Test-Header': 'This is a test' },
queryParams: { param: 'value' },
body: { id: 'abc123' },
overrides: { apiUri: 'https://test.api.nylas.com' },
Expand All @@ -65,7 +60,6 @@ describe('APIClient', () => {
Accept: 'application/json',
Authorization: 'Bearer testApiKey',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip',
'User-Agent': `Nylas Node SDK v${SDK_VERSION}`,
'X-SDK-Test-Header': 'This is a test',
});
Expand All @@ -79,16 +73,12 @@ describe('APIClient', () => {
const options = client.requestOptions({
path: '/test',
method: 'POST',
headers: {
'Accept-Encoding': 'gzip',
},
});

expect(options.method).toBe('POST');
expect(options.headers).toEqual({
Accept: 'application/json',
Authorization: 'Bearer testApiKey',
'Accept-Encoding': 'gzip',
'User-Agent': `Nylas Node SDK v${SDK_VERSION}`,
});
expect(options.url).toEqual(new URL('https://api.us.nylas.com/test'));
Expand Down Expand Up @@ -177,7 +167,6 @@ describe('APIClient', () => {
Accept: ['application/json'],
Authorization: ['Bearer testApiKey'],
'Content-Type': ['application/json'],
'Accept-Encoding': ['gzip'],
'User-Agent': [`Nylas Node SDK v${SDK_VERSION}`],
'X-SDK-Test-Header': ['This is a test'],
'global-header': ['global-value'],
Expand Down

0 comments on commit 68d41f9

Please sign in to comment.