Skip to content

Commit b35e480

Browse files
timokoesslerhansott
authored andcommitted
Fix tests by skipping identical hostnames
Only affects Python 3.8
1 parent 9a9926c commit b35e480

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

aikido_zen/vulnerabilities/ssrf/get_hostname_options.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ def get_hostname_options(raw_hostname: str) -> List[str]:
2020
if hostname_decoded:
2121
options_urls.append(try_parse_url(f"http://{hostname_decoded}"))
2222

23-
# Map to url.hostname
23+
# Map to url.hostname, deduplicating (bracketed and unbracketed
24+
# variants can resolve to the same hostname depending on Python version)
2425
options = []
2526
for options_url in options_urls:
26-
if options_url and options_url.hostname:
27+
if options_url and options_url.hostname and options_url.hostname not in options:
2728
options.append(options_url.hostname)
2829
return options

0 commit comments

Comments
 (0)