Adding a check for the presence of the ssowat header when checking domain is accessible through http

This commit is contained in:
Alexandre Aubin 2016-11-08 12:55:01 -05:00
parent 4ddc3aac36
commit cbc71f2530

View file

@ -685,7 +685,10 @@ def _dns_ip_match_public_ip(public_ip, domain):
def _domain_is_accessible_through_HTTP(ip, domain):
try:
requests.head("http://" + ip, headers={"Host": domain})
r = requests.head("http://" + ip, headers={"Host": domain})
# Check we got the ssowat header in the response
if ("x-sso-wat" not in r.headers.keys()) :
return False
except Exception:
return False