Skip to content

Commit

Permalink
Update STACpopulator/api_requests.py
Browse files Browse the repository at this point in the history
Co-authored-by: David Huard <[email protected]>
  • Loading branch information
fmigneault and huard authored Nov 15, 2023
1 parent bafebbb commit 7215ca6
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 7215ca6

Please sign in to comment.