Looking for ssowat header in https (workaround for when app is installed on root domain)

This commit is contained in:
Alexandre Aubin 2016-11-21 11:24:55 -05:00
parent 5de006f18d
commit c57e343d45

View file

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