automatic header expansion

This commit is contained in:
Kenneth Reitz
2011-08-28 03:22:03 -04:00
parent 3b9fc987b8
commit 2fa180e9ea
+9 -1
View File
@@ -15,7 +15,7 @@ import config
from .models import Request, Response, AuthObject
from .status_codes import codes
from .hooks import dispatch_hook
from .utils import cookiejar_from_dict
from .utils import cookiejar_from_dict, header_expand
from urlparse import urlparse
@@ -48,6 +48,14 @@ def request(method, url,
cookies = cookiejar_from_dict(cookies)
# Expand header values
if headers:
for k, v in headers.items() or {}:
headers[k] = header_expand(v)
# headers = [(k, map(header_expand, v)) for k,v in headers.items()]
# print headers
args = dict(
method = method,
url = url,