Skip to content

Commit b6d37d7

Browse files
committed
minor update regarding IPv6 support
1 parent 9228610 commit b6d37d7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ 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()
1089+
conf.hostname = __hostnamePort[0].strip().strip("[]")
10901090

10911091
try:
10921092
_ = conf.hostname.encode("idna")
@@ -1111,7 +1111,7 @@ def parseTargetUrl():
11111111
if __urlSplit[3]:
11121112
conf.parameters[PLACE.GET] = urldecode(__urlSplit[3]) if __urlSplit[3] and urlencode(DEFAULT_GET_POST_DELIMITER, None) not in __urlSplit[3] else __urlSplit[3]
11131113

1114-
conf.url = "%s://%s:%d%s" % (conf.scheme, conf.hostname, conf.port, conf.path)
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)
11151115
conf.url = conf.url.replace(URI_QUESTION_MARKER, '?')
11161116

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

0 commit comments

Comments
 (0)