diff --git a/flareio/api_client.py b/flareio/api_client.py index 62a4c2f..7c3f0aa 100644 --- a/flareio/api_client.py +++ b/flareio/api_client.py @@ -3,6 +3,7 @@ from datetime import datetime from datetime import timedelta from flareio.exceptions import TokenError +from urllib.parse import urlparse import typing as t @@ -66,7 +67,7 @@ def _request( json: t.Optional[t.Dict[str, t.Any]] = None, headers: t.Optional[t.Dict[str, t.Any]] = None, ) -> requests.Response: - if not url.startswith("https://api.flare.io"): + if not urlparse(url).netloc == "api.flare.io": raise Exception( "Please only use the client to access the api.flare.io domain." )