]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Keep Proxy._build_auth_header as a private method (#1087)
authorTom Christie <tom@tomchristie.com>
Sun, 26 Jul 2020 17:27:07 +0000 (18:27 +0100)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2020 17:27:07 +0000 (18:27 +0100)
httpx/_config.py

index 43f712b8b76cbe020d17b167a40804f681b30c22..9b2c8cba76d342ed0b7a644b3513ad00dd919b4e 100644 (file)
@@ -330,7 +330,7 @@ class Proxy:
         if url.username or url.password:
             headers.setdefault(
                 "Proxy-Authorization",
-                self.build_auth_header(url.username, url.password),
+                self._build_auth_header(url.username, url.password),
             )
             # Remove userinfo from the URL authority, e.g.:
             # 'username:password@proxy_host:proxy_port' -> 'proxy_host:proxy_port'
@@ -340,7 +340,7 @@ class Proxy:
         self.headers = headers
         self.mode = mode
 
-    def build_auth_header(self, username: str, password: str) -> str:
+    def _build_auth_header(self, username: str, password: str) -> str:
         userpass = (username.encode("utf-8"), password.encode("utf-8"))
         token = b64encode(b":".join(userpass)).decode()
         return f"Basic {token}"