From 47aa0afe91defeb3b4f24d64031a38d5b7607520 Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Fri, 30 Jan 2026 18:11:08 -0600 Subject: [PATCH] Fix proactive caching failing on HTTP->HTTPS redirects The background dependency caching was getting 308 redirects because request.base_url returns http:// but the ingress redirects to https://. Enable follow_redirects=True in httpx client to handle this. --- backend/app/pypi_proxy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/pypi_proxy.py b/backend/app/pypi_proxy.py index 5582fe0..54bd59e 100644 --- a/backend/app/pypi_proxy.py +++ b/backend/app/pypi_proxy.py @@ -528,7 +528,7 @@ def _cache_dependency_background( simple_url = f"{base_url}/pypi/simple/{normalized_name}/" logger.info(f"PyPI proxy: proactively caching {dep_name} (depth={depth})") - with httpx.Client(timeout=30.0) as client: + with httpx.Client(timeout=30.0, follow_redirects=True) as client: response = client.get(simple_url) if response.status_code != 200: logger.warning(f"PyPI proxy: failed to get index for {dep_name}: {response.status_code}")