self, username: typing.Union[str, bytes], password: typing.Union[str, bytes]
) -> str:
userpass = b":".join((to_bytes(username), to_bytes(password)))
- token = b64encode(userpass).decode().strip()
+ token = b64encode(userpass).decode()
return f"Basic {token}"
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().strip()
+ token = b64encode(b":".join(userpass)).decode()
return f"Basic {token}"
def __repr__(self) -> str: