Skip to content

Commit

Permalink
utf8 encode basic auth username/password
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Mar 12, 2020
1 parent e4e1eda commit 7620217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/treq/auth.py
Expand Up @@ -28,7 +28,7 @@ def request(self, method, uri, headers=None, bodyProducer=None):

def add_basic_auth(agent, username, password):
creds = base64.b64encode(
'{0}:{1}'.format(username, password).encode('ascii'))
u'{}:{}'.format(username, password).encode('utf8'))
return _RequestHeaderSettingAgent(
agent,
Headers({b'Authorization': [b'Basic ' + creds]}))
Expand Down

0 comments on commit 7620217

Please sign in to comment.