Skip to content

Commit 26fae70

Browse files
Fix relative index URLs (#230)
* Fix relative index URLs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent d31dc66 commit 26fae70

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

micropip/package_index.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from dataclasses import dataclass
88
from functools import partial
99
from typing import Any
10-
from urllib.parse import urljoin, urlparse, urlunparse
10+
from urllib.parse import urljoin, urlparse
1111

1212
from ._compat import CompatibilityLayer
1313
from ._utils import is_package_compatible, parse_version
@@ -329,9 +329,7 @@ async def query_package(
329329

330330
content_type = headers.get("content-type", "").lower()
331331
try:
332-
base_url = urlunparse(urlparse(url)._replace(path=""))
333-
334-
parser = _select_parser(content_type, name, index_base_url=base_url)
332+
parser = _select_parser(content_type, name, index_base_url=url)
335333
except ValueError as e:
336334
raise ValueError(f"Error trying to decode url: {url}") from e
337335
return parser(metadata)

0 commit comments

Comments
 (0)