Skip to content

Commit 5d36dd8

Browse files
committed
slight refactor
1 parent 927f415 commit 5d36dd8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/stac_auth_proxy/utils/lifespan.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ async def check_conformance(
5858
middleware_classes: list[Middleware],
5959
api_url: str,
6060
attr_name: str = "__required_conformances__",
61+
endpoint: str = "/conformance",
6162
):
6263
"""Check if the upstream API supports a given conformance class."""
6364
required_conformances: dict[str, list[str]] = {}
@@ -68,10 +69,11 @@ async def check_conformance(
6869
middleware.cls.__name__
6970
)
7071

71-
async with httpx.AsyncClient() as client:
72-
response = await client.get(f"{api_url}/conformance")
72+
async with httpx.AsyncClient(base_url=api_url) as client:
73+
response = await client.get(endpoint)
7374
response.raise_for_status()
7475
api_conforms_to = response.json().get("conformsTo", [])
76+
7577
missing = [
7678
req_conformance
7779
for req_conformance in required_conformances.keys()

0 commit comments

Comments
 (0)