Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b2cd44

Browse files
committed
proper fix
1 parent 7031ef8 commit 1b2cd44

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

lib/core/common.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,18 @@ def parseTargetUrl():
11071107
conf.url = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, conf.path)
11081108
conf.url = conf.url.replace(URI_QUESTION_MARKER, '?')
11091109

1110+
if not conf.referer and intersect(REFERER_ALIASES, conf.testParameter, True):
1111+
debugMsg = "setting the HTTP Referer header to the target url"
1112+
logger.debug(debugMsg)
1113+
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.REFERER, conf.httpHeaders)
1114+
conf.httpHeaders.append((HTTPHEADER.REFERER, conf.url))
1115+
1116+
if not conf.host and intersect(HOST_ALIASES, conf.testParameter, True):
1117+
debugMsg = "setting the HTTP Host header to the target url"
1118+
logger.debug(debugMsg)
1119+
conf.httpHeaders = filter(lambda (key, value): key != HTTPHEADER.HOST, conf.httpHeaders)
1120+
conf.httpHeaders.append((HTTPHEADER.HOST, getHostHeader(conf.url)))
1121+
11101122
def expandAsteriskForColumns(expression):
11111123
"""
11121124
If the user provided an asterisk rather than the column(s)

0 commit comments

Comments
 (0)