From 3c2ab70ef075cba354885721a59eff792586ec25 Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Fri, 30 Jan 2026 18:59:31 -0600 Subject: [PATCH] Fix proactive dependency caching HTTPS redirect issue When background threads fetch from our own proxy using the request's base_url, it returns http:// but ingress requires https://. The 308 redirect was dropping trailing slashes, causing requests to hit the frontend catch-all route instead of /pypi/simple/. Force HTTPS explicitly in the background caching function to avoid the redirect entirely. --- backend/app/pypi_proxy.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/pypi_proxy.py b/backend/app/pypi_proxy.py index 287426d..87678eb 100644 --- a/backend/app/pypi_proxy.py +++ b/backend/app/pypi_proxy.py @@ -525,6 +525,9 @@ def _cache_dependency_background( normalized_name = re.sub(r'[-_.]+', '-', dep_name).lower() # First, get the simple index page to find available versions + # Use HTTPS explicitly to avoid redirect issues that can drop trailing slashes + if base_url.startswith('http://'): + base_url = 'https://' + base_url[7:] simple_url = f"{base_url}/pypi/simple/{normalized_name}/" logger.info(f"PyPI proxy: proactively caching {dep_name} (depth={depth})")