minor update

This commit is contained in:
Miroslav Stampar 2012-01-07 15:26:54 +00:00
parent 3f4afdf251
commit 5a8fc44119
3 changed files with 3 additions and 4 deletions

View File

@ -1073,11 +1073,11 @@ def __setHTTPExtraHeaders():
debugMsg = "setting extra HTTP headers"
logger.debug(debugMsg)
conf.headers = conf.headers.split("\n")
conf.headers = conf.headers.split("\n") if "\n" in conf.headers else conf.headers.split("\\n")
for headerValue in conf.headers:
if ":" in headerValue:
header, value = headerValue.split(":")
header, value = (_.lstrip() for _ in headerValue.split(":"))
if header and value:
conf.httpHeaders.append((header, value))

View File

@ -99,7 +99,7 @@ def cmdLineParser():
help="HTTP Referer header")
request.add_option("--headers", dest="headers",
help="Extra HTTP headers newline separated")
help="Extra headers (e.g. \"Accept-Language: fr\\nETag: 123\")")
request.add_option("--auth-type", dest="aType",
help="HTTP authentication type "

View File

@ -70,7 +70,6 @@ referer =
rParam =
# Extra HTTP headers
# Note: There must be a space at the beginning of each header line.
headers = Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7