Skip to content

Commit

Permalink
Add trust_env
Browse files Browse the repository at this point in the history
  • Loading branch information
phvalguima committed Oct 19, 2023
1 parent bd79b2e commit 43af202
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/integration/high_availability/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from urllib.parse import urlparse


def NoProxyExtendClient(config: SingleConfig, timeout: httpx.Timeout) -> httpx.Client:
def NoProxyExtendClient(config: SingleConfig, timeout: httpx.Timeout, trust_env=True) -> httpx.Client:
"""Reviews the NO_PROXY setting: it must contain the base_url's IP/hostname, otherwise add it."""
if "HTTP_PROXY" in os.environ.keys() or "HTTPS_PROXY" in os.environ.keys():
# urlparse returns an <ip>|<hostname>:<port>, we do not need the port
Expand All @@ -49,7 +49,7 @@ def NoProxyExtendClient(config: SingleConfig, timeout: httpx.Timeout) -> httpx.C
if host not in os.environ["NO_PROXY"].split(","): # compare with a list, as we want to avoid matching "192.168.0.1" "192.168.0.1/24,10.0.0.0/8" string
os.environ["NO_PROXY"] = ",".join([host, os.environ["NO_PROXY"] ])
print("TESTING" + os.environ["NO_PROXY"])
return httpx.Client(**httpx_parameters(config, timeout))
return httpx.Client(**httpx_parameters(config, timeout, trust_env))

# Override the AdapterClient
GenericClient.AdapterClient = staticmethod(NoProxyExtendClient)
Expand Down

0 comments on commit 43af202

Please sign in to comment.