Skip to content

Commit 86fdad2

Browse files
committed
minor update
1 parent eed8d7e commit 86fdad2

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

lib/controller/checks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,12 @@ def checkConnection(suppressOutput=False):
993993
logger.info(infoMsg)
994994

995995
try:
996+
if conf.ipv6:
997+
warnMsg = "always check connection to provided "
998+
warnMsg += "IPv6 address with a tool like ping6 "
999+
warnMsg += "(e.g. 'ping6 fe80::20c:29ff:fea8:6bf1%vmnet8')"
1000+
singleTimeWarnMessage(warnMsg)
1001+
9961002
page, _ = Request.queryPage(content=True, noteResponseTime=False)
9971003
kb.originalPage = kb.pageTemplate = page
9981004

lib/core/common.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,11 @@ def parseTargetUrl():
10861086

10871087
conf.scheme = __urlSplit[0].strip().lower() if not conf.forceSSL else "https"
10881088
conf.path = __urlSplit[2].strip()
1089-
conf.hostname = __hostnamePort[0].strip().strip("[]")
1089+
conf.hostname = __hostnamePort[0].strip()
1090+
1091+
conf.ipv6 = conf.hostname != conf.hostname.strip("[]")
1092+
conf.hostname = conf.hostname.strip("[]")
1093+
10901094

10911095
try:
10921096
_ = conf.hostname.encode("idna")
@@ -1111,7 +1115,7 @@ def parseTargetUrl():
11111115
if __urlSplit[3]:
11121116
conf.parameters[PLACE.GET] = urldecode(__urlSplit[3]) if __urlSplit[3] and urlencode(DEFAULT_GET_POST_DELIMITER, None) not in __urlSplit[3] else __urlSplit[3]
11131117

1114-
conf.url = "%s://%s:%d%s" % (conf.scheme, ("[%s]" % conf.hostname) if __hostnamePort[0].strip("[]") != __hostnamePort[0] else conf.hostname, conf.port, conf.path)
1118+
conf.url = "%s://%s:%d%s" % (conf.scheme, ("[%s]" % conf.hostname) if conf.ipv6 else conf.hostname, conf.port, conf.path)
11151119
conf.url = conf.url.replace(URI_QUESTION_MARKER, '?')
11161120

11171121
if not conf.referer and intersect(REFERER_ALIASES, conf.testParameter, True):

lib/core/option.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,7 @@ def __setConfAttributes():
13881388
conf.hashDBFile = None
13891389
conf.httpHeaders = []
13901390
conf.hostname = None
1391+
conf.ipv6 = False
13911392
conf.multipleTargets = False
13921393
conf.outputPath = None
13931394
conf.paramDict = {}

0 commit comments

Comments
 (0)