Skip to content

Commit

Permalink
Merge branch 'stac-dir-populator' of https://github.com/crim-ca/stac-…
Browse files Browse the repository at this point in the history
…populator into stac-dir-populator
  • Loading branch information
fmigneault committed Nov 16, 2023
2 parents eb525fa + 7215ca6 commit 11a464f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions STACpopulator/api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def stac_host_reachable(url: str, session: Optional[Session] = None) -> bool:
response = session.get(url, headers={"Accept": "application/json"})
response.raise_for_status()
body = response.json()
if body["type"] == "Catalog" and "stac_version" in body:
return True
return body["type"] == "Catalog" and "stac_version" in body

except (requests.exceptions.RequestException, requests.exceptions.ConnectionError) as exc:
LOGGER.error("Could not validate STAC host. Not reachable [%s] due to [%s]", url, exc, exc_info=exc)
return False
Expand Down

0 comments on commit 11a464f

Please sign in to comment.