mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Adding a check for the presence of the ssowat header when checking domain is accessible through http
This commit is contained in:
parent
4ddc3aac36
commit
cbc71f2530
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue