From: Tom Christie Date: Sun, 26 Jul 2020 17:27:07 +0000 (+0100) Subject: Keep Proxy._build_auth_header as a private method (#1087) X-Git-Tag: 0.14.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50b17fdd65fd06432842ec55011ec8d1db0457a8;p=thirdparty%2Fhttpx.git Keep Proxy._build_auth_header as a private method (#1087) --- diff --git a/httpx/_config.py b/httpx/_config.py index 43f712b8..9b2c8cba 100644 --- a/httpx/_config.py +++ b/httpx/_config.py @@ -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}"