You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Added support and tests for unicode support in sessions.
This commit is contained in:
@@ -19,11 +19,16 @@ class HTTPBasicAuth(requests.auth.HTTPBasicAuth):
|
||||
See https://github.com/jkbr/httpie/issues/212
|
||||
|
||||
"""
|
||||
credentials = u'%s:%s' % (self.username, self.password)
|
||||
token = b64encode(credentials.encode('utf8')).strip().decode('latin1')
|
||||
r.headers['Authorization'] = 'Basic %s' % token
|
||||
r.headers['Authorization'] = type(self).make_header(
|
||||
self.username, self.password).encode('latin1')
|
||||
return r
|
||||
|
||||
@staticmethod
|
||||
def make_header(username, password):
|
||||
credentials = u'%s:%s' % (username, password)
|
||||
token = b64encode(credentials.encode('utf8')).strip().decode('latin1')
|
||||
return 'Basic %s' % token
|
||||
|
||||
|
||||
class BasicAuthPlugin(BuiltinAuthPlugin):
|
||||
|
||||
|
Reference in New Issue
Block a user