From 0fa991f536f869892498fe1af7d2e58eaed6d118 Mon Sep 17 00:00:00 2001 From: Mondo Diaz Date: Fri, 30 Jan 2026 09:24:05 -0600 Subject: [PATCH] Allow full path in PyPI upstream source URL Users can now configure the full path including /simple in their upstream source URL (e.g., https://example.com/api/pypi/repo/simple) instead of having the code append /simple/ automatically. This matches pip's --index-url format, making configuration more intuitive and copy/paste friendly. --- backend/app/pypi_proxy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/app/pypi_proxy.py b/backend/app/pypi_proxy.py index 9cbaa9a..164995f 100644 --- a/backend/app/pypi_proxy.py +++ b/backend/app/pypi_proxy.py @@ -180,7 +180,8 @@ async def pypi_simple_index( headers.update(_build_auth_headers(source)) auth = _get_basic_auth(source) - simple_url = source.url.rstrip('/') + '/simple/' + # Use URL as-is - users should provide full path including /simple + simple_url = source.url.rstrip('/') + '/' timeout = httpx.Timeout(PROXY_READ_TIMEOUT, connect=PROXY_CONNECT_TIMEOUT) @@ -268,7 +269,8 @@ async def pypi_package_versions( headers.update(_build_auth_headers(source)) auth = _get_basic_auth(source) - package_url = source.url.rstrip('/') + f'/simple/{normalized_name}/' + # Use URL as-is - users should provide full path including /simple + package_url = source.url.rstrip('/') + f'/{normalized_name}/' final_url = package_url # Track final URL after redirects timeout = httpx.Timeout(PROXY_READ_TIMEOUT, connect=PROXY_CONNECT_TIMEOUT)