Skip to content

Commit

Permalink
Ref #772 - Fix bug in sectxt canonical check
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Aug 3, 2023
1 parent 6b9c852 commit 8df8854
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions checks/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,13 @@ def http_get_ip(
session = requests.session()
session.mount(f"https://{hostname}", ForcedIPHTTPSAdapter(dest_ip=ip))
if https:
url = f"https://{hostname}:{port}/{path}"
port_suffix = "" if port == 443 else f":{port}"
url = f"https://{hostname}{port_suffix}/{path}"
else:
if ":" in ip:
ip = f"[{ip}]"
url = f"http://{ip}:{port}/{path}"
port_suffix = "" if port == 80 else f":{port}"
url = f"http://{ip}{port_suffix}/{path}"
headers["Host"] = hostname
return http_get(url, verify=False, headers=headers, session=session, *args, **kwargs)

Expand Down

0 comments on commit 8df8854

Please sign in to comment.