From d71deba7cbea4503c0396f2e3313838c93323723 Mon Sep 17 00:00:00 2001 From: karosis88 Date: Tue, 10 Oct 2023 16:43:43 +0300 Subject: [PATCH] Make proxy check explicit --- httpx/_transports/default.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpx/_transports/default.py b/httpx/_transports/default.py index f2f9abc9db..3e4ed78394 100644 --- a/httpx/_transports/default.py +++ b/httpx/_transports/default.py @@ -132,7 +132,7 @@ def __init__( ) -> None: ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env) - if proxy and isinstance(proxy, str): + if proxy is not None and isinstance(proxy, str): proxy = Proxy(url=proxy) if proxy is None: @@ -274,7 +274,7 @@ def __init__( ) -> None: ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env) - if proxy and isinstance(proxy, str): + if proxy is not None and isinstance(proxy, str): proxy = Proxy(url=proxy) if proxy is None: