Skip to content

Fix relative index URLs #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions micropip/package_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from dataclasses import dataclass
from functools import partial
from typing import Any
from urllib.parse import urljoin, urlparse, urlunparse
from urllib.parse import urljoin, urlparse

from ._compat import HttpStatusError, fetch_string_and_headers
from ._utils import is_package_compatible, parse_version
Expand Down Expand Up @@ -324,9 +324,7 @@ async def query_package(

content_type = headers.get("content-type", "").lower()
try:
base_url = urlunparse(urlparse(url)._replace(path=""))

parser = _select_parser(content_type, name, index_base_url=base_url)
parser = _select_parser(content_type, name, index_base_url=url)
except ValueError as e:
raise ValueError(f"Error trying to decode url: {url}") from e
return parser(metadata)
Expand Down