Minor adjustment (for headers like 'name:http://asdas')

This commit is contained in:
Miroslav Stampar 2013-05-23 11:29:43 +04:00
parent 19b87074c6
commit eb8e12b7c2

View File

@ -1196,8 +1196,8 @@ def _setHTTPExtraHeaders():
conf.headers = conf.headers.split("\n") if "\n" in conf.headers else conf.headers.split("\\n")
for headerValue in conf.headers:
if headerValue.count(':') == 1:
header, value = (_.lstrip() for _ in headerValue.split(":"))
if headerValue.count(':') > 1:
header, value = (_.lstrip() for _ in headerValue.split(":", 1))
if header and value:
conf.httpHeaders.append((header, value))