From 21c6b5219802c2448f0e146987fffee668368943 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 23 Apr 2012 10:11:00 +0000 Subject: [PATCH] minor fix --- lib/core/option.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/core/option.py b/lib/core/option.py index 5c4220b83..595574a76 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1097,11 +1097,14 @@ def __setHTTPExtraHeaders(): conf.headers = conf.headers.split("\n") if "\n" in conf.headers else conf.headers.split("\\n") for headerValue in conf.headers: - if ":" in headerValue: + if headerValue.count(':') == 1: header, value = (_.lstrip() for _ in headerValue.split(":")) if header and value: conf.httpHeaders.append((header, value)) + else: + errMsg = "Invalid header value: %s" % repr(headerValue).lstrip('u') + raise sqlmapSyntaxException, errMsg elif not conf.httpHeaders or len(conf.httpHeaders) == 1: conf.httpHeaders.append((HTTPHEADER.ACCEPT_LANGUAGE, "en-us,en;q=0.5"))