Commit c10c5931 authored by Romain Courteaud's avatar Romain Courteaud

Fix http checking

parent 6b379648
...@@ -104,10 +104,16 @@ def checkHttpStatus(db, status_id, url, ip, bot_version): ...@@ -104,10 +104,16 @@ def checkHttpStatus(db, status_id, url, ip, bot_version):
(parsed_url.scheme, parsed_url.netloc, "", "", "") (parsed_url.scheme, parsed_url.netloc, "", "", "")
) )
session.mount(base_url, ForcedIPHTTPSAdapter(dest_ip=ip)) session.mount(base_url, ForcedIPHTTPSAdapter(dest_ip=ip))
ip_url = url
elif parsed_url.scheme == "http":
# Force IP location
parsed_url = parsed_url._replace(netloc=ip)
ip_url = parsed_url.geturl()
response = request( response = request(
"GET", "GET",
url, ip_url,
headers={"Host": hostname}, headers={"Host": hostname},
session=session, session=session,
version=bot_version, version=bot_version,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment