Skip to content
Myr

Keep Proxy._build_auth_header as a private method (#1087)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by GitHub · parent 2d491c9 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:httpx/_config.py+2 added-2 removed
328 unmodified lines
329330 if url.username or url.password:331 headers.setdefault(332 "Proxy-Authorization",333 self.build_auth_header(url.username, url.password),333 self._build_auth_header(url.username, url.password),334 )335 # Remove userinfo from the URL authority, e.g.:336 # 'username:password@proxy_host:proxy_port' -> 'proxy_host:proxy_port'337 url = url.copy_with(username=None, password=None)
1 unmodified line
339 self.url = url340 self.headers = headers341 self.mode = mode342343 def build_auth_header(self, username: str, password: str) -> str:343 def _build_auth_header(self, username: str, password: str) -> str:344 userpass = (username.encode("utf-8"), password.encode("utf-8"))345 token = b64encode(b":".join(userpass)).decode()346 return f"Basic {token}"347
11 unmodified lines