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
3 changes: 3 additions & 0 deletions airbyte_cdk/sources/streams/http/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,9 @@ def send_request(
data=data,
)

env_settings = self._session.merge_environment_settings(request.url, None, None, None, None)
Copy link
Contributor

@aaronsteers aaronsteers Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request_kwargs = {**request_kwargs, **env_settings}

response: requests.Response = self._send_with_retry(
request=request,
request_kwargs=request_kwargs,
Expand Down
21 changes: 21 additions & 0 deletions unit_tests/sources/streams/http/test_http_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.

import logging
import os
from datetime import timedelta
from unittest.mock import MagicMock, patch

Expand Down Expand Up @@ -744,3 +745,23 @@ def test_given_different_headers_then_response_is_not_cached(requests_mock):
)

assert second_response.json()["test"] == "second response"

@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."""
http_client = HttpClient(
name="test",
logger=MagicMock(),
)

with patch.object(http_client, '_send_with_retry') as mock_send_with_retry:
http_client.send_request(
http_method="GET",
url="https://api.example.com",
request_kwargs={"timeout": 10}
)

passed_kwargs = mock_send_with_retry.call_args[1]["request_kwargs"]

assert "verify" in passed_kwargs
assert passed_kwargs["verify"] == "/path/to/ca-bundle.crt"
Loading