aboutsummaryrefslogtreecommitdiff
path: root/urllib3/util/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'urllib3/util/request.py')
-rw-r--r--urllib3/util/request.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/urllib3/util/request.py b/urllib3/util/request.py
index bfd7a98..bc64f6b 100644
--- a/urllib3/util/request.py
+++ b/urllib3/util/request.py
@@ -1,7 +1,6 @@
from base64 import b64encode
-from ..packages import six
-
+from ..packages.six import b
ACCEPT_ENCODING = 'gzip,deflate'
@@ -29,13 +28,13 @@ def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
auth header.
:param proxy_basic_auth:
- Colon-separated username:password string for
- 'proxy-authorization: basic ...' auth header.
+ Colon-separated username:password string for 'proxy-authorization: basic ...'
+ auth header.
:param disable_cache:
If ``True``, adds 'cache-control: no-cache' header.
- Example: ::
+ Example::
>>> make_headers(keep_alive=True, user_agent="Batman/1.0")
{'connection': 'keep-alive', 'user-agent': 'Batman/1.0'}
@@ -60,11 +59,11 @@ def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,
if basic_auth:
headers['authorization'] = 'Basic ' + \
- b64encode(six.b(basic_auth)).decode('utf-8')
+ b64encode(b(basic_auth)).decode('utf-8')
if proxy_basic_auth:
headers['proxy-authorization'] = 'Basic ' + \
- b64encode(six.b(proxy_basic_auth)).decode('utf-8')
+ b64encode(b(proxy_basic_auth)).decode('utf-8')
if disable_cache:
headers['cache-control'] = 'no-cache'