feat(chalice): ignore more html-sourcemaps

This commit is contained in:
Taha Yassine Kraiem 2022-11-18 16:23:25 +01:00
parent a2b2cd6f86
commit 287ba8163c

View file

@ -77,7 +77,7 @@ def format_payload(p, truncate_to_first=False):
def url_exists(url):
try:
r = requests.head(url, allow_redirects=False)
return r.status_code == 200 and r.headers.get("Content-Type") != "text/html"
return r.status_code == 200 and "text/html" not in r.headers.get("Content-Type", "")
except Exception as e:
print(f"!! Issue checking if URL exists: {url}")
print(e)