From 91e9e8d59e33f599d1161ab696871daf02ee58fe Mon Sep 17 00:00:00 2001 From: Andrei Matveyeu Date: Mon, 14 Oct 2024 10:10:04 +0200 Subject: [PATCH] Restore docker.py --- python/src/etos_api/library/docker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/src/etos_api/library/docker.py b/python/src/etos_api/library/docker.py index 8294189..8e1ca04 100644 --- a/python/src/etos_api/library/docker.py +++ b/python/src/etos_api/library/docker.py @@ -92,8 +92,10 @@ async def authorize( else: query[key] = value.strip('"') - if not url: - raise ValueError(f"No realm found in www-authenticate header: {www_auth_header}") + if not isinstance(url, str) or not ( + url.startswith("http://") or url.startswith("https://") + ): + raise ValueError(f"No realm URL found in www-authenticate header: {www_auth_header}") async with session.get(url, params=query) as response: response.raise_for_status()