diff --git a/lib/core/option.py b/lib/core/option.py index 0bf4c6b3f..4b7e041a9 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -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)) diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 1ef689c77..d3fc3c5e6 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -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 " diff --git a/sqlmap.conf b/sqlmap.conf index 6a1f0d3c7..28bd5386f 100644 --- a/sqlmap.conf +++ b/sqlmap.conf @@ -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