Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte_cdk/sources/streams/http/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def send_request(

env_settings = self._session.merge_environment_settings(
url=request.url,
proxies=request_kwargs.get("proxies"),
proxies=request_kwargs.get("proxies", {}),
stream=request_kwargs.get("stream"),
verify=request_kwargs.get("verify"),
cert=request_kwargs.get("cert"),
Expand Down
16 changes: 16 additions & 0 deletions unit_tests/sources/streams/http/test_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,22 @@ def test_given_different_headers_then_response_is_not_cached(requests_mock):
assert second_response.json()["test"] == "second response"


def test_given_noproxy_for_another_url_when_send_request_then_do_not_break(requests_mock):
http_client = HttpClient(name="test", logger=MagicMock(), use_cache=True)
os.environ["no_proxy"] = "another.com"
requests_mock.register_uri(
"GET",
"https://google.com/",
json={"test": "a response"},
)

x = http_client.send_request(
"GET", "https://google.com/", request_kwargs={}
)

assert x


@patch.dict("os.environ", {"REQUESTS_CA_BUNDLE": "/path/to/ca-bundle.crt"})
def test_send_request_respects_environment_variables():
"""Test that send_request respects REQUESTS_CA_BUNDLE environment variable."""
Expand Down
Loading