From 89b466421e2b6d62b82a5961ecce2e244ffc13f0 Mon Sep 17 00:00:00 2001 From: Subash Pradhan Date: Wed, 30 Oct 2024 17:42:34 +0100 Subject: [PATCH] Revert "adding this header reduces the networking by 10X" --- nylas/handler/http_client.py | 1 - tests/handler/test_http_client.py | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/nylas/handler/http_client.py b/nylas/handler/http_client.py index ee29665..5b1d77a 100644 --- a/nylas/handler/http_client.py +++ b/nylas/handler/http_client.py @@ -179,7 +179,6 @@ def _build_headers( "X-Nylas-API-Wrapper": "python", "User-Agent": user_agent_header, "Authorization": f"Bearer {api_key}", - "Accept-Encoding": "gzip", } if data is not None and data.content_type is not None: headers["Content-type"] = data.content_type diff --git a/tests/handler/test_http_client.py b/tests/handler/test_http_client.py index 4f5cd98..e6a6157 100644 --- a/tests/handler/test_http_client.py +++ b/tests/handler/test_http_client.py @@ -34,7 +34,6 @@ def test_build_headers_default(self, http_client, patched_version_and_sys): "X-Nylas-API-Wrapper": "python", "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", - "Accept-Encoding": "gzip", } def test_build_headers_extra_headers(self, http_client, patched_version_and_sys): @@ -51,7 +50,6 @@ def test_build_headers_extra_headers(self, http_client, patched_version_and_sys) "Authorization": "Bearer test-key", "foo": "bar", "X-Test": "test", - "Accept-Encoding": "gzip", } def test_build_headers_json_body(self, http_client, patched_version_and_sys): @@ -66,7 +64,6 @@ def test_build_headers_json_body(self, http_client, patched_version_and_sys): "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", "Content-type": "application/json", - "Accept-Encoding": "gzip", } def test_build_headers_form_body(self, http_client, patched_version_and_sys): @@ -82,7 +79,6 @@ def test_build_headers_form_body(self, http_client, patched_version_and_sys): "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", "Content-type": "application/x-www-form-urlencoded", - "Accept-Encoding": "gzip", } def test_build_headers_override_headers(self, http_client, patched_version_and_sys): @@ -101,7 +97,6 @@ def test_build_headers_override_headers(self, http_client, patched_version_and_s "Authorization": "Bearer test-key", "foo": "bar", "X-Test": "test", - "Accept-Encoding": "gzip", } def test_build_headers_override_api_key(self, http_client, patched_version_and_sys): @@ -115,7 +110,6 @@ def test_build_headers_override_api_key(self, http_client, patched_version_and_s "X-Nylas-API-Wrapper": "python", "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key-override", - "Accept-Encoding": "gzip", } def test_build_request_default(self, http_client, patched_version_and_sys): @@ -131,7 +125,6 @@ def test_build_request_default(self, http_client, patched_version_and_sys): "X-Nylas-API-Wrapper": "python", "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", - "Accept-Encoding": "gzip", }, } @@ -151,7 +144,6 @@ def test_build_request_override_api_uri(self, http_client, patched_version_and_s "X-Nylas-API-Wrapper": "python", "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", - "Accept-Encoding": "gzip", }, } @@ -209,7 +201,6 @@ def test_execute_download_request_override_timeout( "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", "Content-type": "application/json", - "Accept-Encoding": "gzip", }, timeout=60, stream=False, @@ -300,7 +291,6 @@ def test_execute(self, http_client, patched_version_and_sys, patched_request): "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", "Content-type": "application/json", - "Accept-Encoding": "gzip", "test": "header", }, json={"foo": "bar"}, @@ -329,7 +319,6 @@ def test_execute_override_timeout( "User-Agent": "Nylas Python SDK 2.0.0 - 1.2.3", "Authorization": "Bearer test-key", "Content-type": "application/json", - "Accept-Encoding": "gzip", "test": "header", }, json={"foo": "bar"},