]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
client.netrc should be private (#1071)
authorTom Christie <tom@tomchristie.com>
Thu, 23 Jul 2020 08:44:54 +0000 (09:44 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Jul 2020 08:44:54 +0000 (09:44 +0100)
httpx/_client.py

index 1ee93521723d0f4ae81b0b1b6aff110b8972a1be..d4ec7aaa540dcdeb5e7fbe1c4e535699ad70c418 100644 (file)
@@ -80,7 +80,7 @@ class BaseClient:
         self.timeout = Timeout(timeout)
         self.max_redirects = max_redirects
         self.trust_env = trust_env
-        self.netrc = NetRCInfo()
+        self._netrc = NetRCInfo()
 
     def _get_proxy_map(
         self, proxies: typing.Optional[ProxiesTypes], trust_env: bool,
@@ -269,7 +269,7 @@ class BaseClient:
             return BasicAuth(username=username, password=password)
 
         if self.trust_env and "Authorization" not in request.headers:
-            credentials = self.netrc.get_credentials(request.url.authority)
+            credentials = self._netrc.get_credentials(request.url.authority)
             if credentials is not None:
                 return BasicAuth(username=credentials[0], password=credentials[1])