1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Modernize the code base with f-strings (#1068)

This commit is contained in:
Mickaël Schoentgen
2021-05-25 20:49:07 +02:00
committed by GitHub
parent 39314887c4
commit 0ff0874fa3
9 changed files with 43 additions and 63 deletions

View File

@@ -29,9 +29,9 @@ class HTTPBasicAuth(requests.auth.HTTPBasicAuth):
@staticmethod
def make_header(username: str, password: str) -> str:
credentials = u'%s:%s' % (username, password)
token = b64encode(credentials.encode('utf8')).strip().decode('latin1')
return 'Basic %s' % token
credentials = f'{username}:{password}'
token = b64encode(credentials.encode('utf-8')).strip().decode('latin1')
return f'Basic {token}'
class BasicAuthPlugin(BuiltinAuthPlugin):