From 1b2cd44255459dc941f3f002f6301f03cb3e9b18 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 4 Apr 2012 10:35:52 +0000 Subject: [PATCH] proper fix --- lib/core/common.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/core/common.py b/lib/core/common.py index fc0ad27fb..c8b2a2fa5 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1107,6 +1107,18 @@ def parseTargetUrl(): conf.url = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, conf.path) conf.url = conf.url.replace(URI_QUESTION_MARKER, '?') + if not conf.referer and intersect(REFERER_ALIASES, conf.testParameter, True): + debugMsg = "setting the HTTP Referer header to the target url" + logger.debug(debugMsg) + conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.REFERER, conf.httpHeaders) + conf.httpHeaders.append((HTTPHEADER.REFERER, conf.url)) + + if not conf.host and intersect(HOST_ALIASES, conf.testParameter, True): + debugMsg = "setting the HTTP Host header to the target url" + logger.debug(debugMsg) + conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders) + conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url))) + def expandAsteriskForColumns(expression): """ If the user provided an asterisk rather than the column(s)