mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
Avoid unnecessary encode/decode cycles.
This commit is contained in:
+4
-4
@@ -25,11 +25,11 @@ CONTENT_TYPE_MULTI_PART = 'multipart/form-data'
|
||||
def _basic_auth_str(username, password):
|
||||
"""Returns a Basic Auth string."""
|
||||
|
||||
authstr = 'Basic ' + b64encode(
|
||||
('%s:%s' % (username, password)).encode('latin1')
|
||||
).strip()
|
||||
authstr = 'Basic ' + to_native_string(
|
||||
b64encode(('%s:%s' % (username, password)).encode('latin1')).strip()
|
||||
)
|
||||
|
||||
return to_native_string(authstr, encoding='latin1')
|
||||
return authstr
|
||||
|
||||
|
||||
class AuthBase(object):
|
||||
|
||||
Reference in New Issue
Block a user