Skip to content

Commit

Permalink
Revert "adding this header reduces the networking by 10X"
Browse files Browse the repository at this point in the history
  • Loading branch information
SubashPradhan authored Oct 30, 2024
1 parent 3ebb704 commit 89b4664
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion nylas/handler/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions tests/handler/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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):
Expand All @@ -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",
},
}

Expand All @@ -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",
},
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"},
Expand Down Expand Up @@ -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"},
Expand Down

0 comments on commit 89b4664

Please sign in to comment.