From 0d1402ca0a5d4ca38c46abd94a7756713d36f439 Mon Sep 17 00:00:00 2001 From: Subash Pradhan Date: Wed, 30 Oct 2024 17:54:48 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Adding=20gzip=20headers=20to=20reduce?= =?UTF-8?q?=20payload=20sizes=20and=20enable=20compression=20(#=E2=80=A6"?= =?UTF-8?q?=20(#594)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 214cb589c964165272fc0b12bd8c49dc98791324. --- src/apiClient.ts | 1 - tests/apiClient.spec.ts | 13 +------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/apiClient.ts b/src/apiClient.ts index e07d56cc..408c14d1 100644 --- a/src/apiClient.ts +++ b/src/apiClient.ts @@ -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) { diff --git a/tests/apiClient.spec.ts b/tests/apiClient.spec.ts index b2756365..b2f6b478 100644 --- a/tests/apiClient.spec.ts +++ b/tests/apiClient.spec.ts @@ -20,7 +20,6 @@ describe('APIClient', () => { timeout: 30, headers: { 'X-SDK-Test-Header': 'This is a test', - 'Accept-Encoding': 'gzip', }, }); @@ -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', }); }); }); @@ -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' }, @@ -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', }); @@ -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')); @@ -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'],