Skip to content

Simple HTML repository relative URLs are broken #229

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
juntyr opened this issue Apr 6, 2025 · 1 comment · May be fixed by #230
Open

Simple HTML repository relative URLs are broken #229

juntyr opened this issue Apr 6, 2025 · 1 comment · May be fixed by #230

Comments

@juntyr
Copy link

juntyr commented Apr 6, 2025

#150 (cc @Carreau) introduced support for relative index URLs. Unfortunately, the transformation from relative to absolute is broken:

base_url = urlunparse(urlparse(url)._replace(path=""))

For an index at e.g. /main/pypa/simple/ and a package URL /main/pypa/simple/numpy/, the relative wheel file URL is made absolute to /, not to /main/pypa/simple/numpy/. This goes against HTML redirects and thus seems to go against the spec, which states (for the simple JSON spec which builds on the HTML spec) "If relative, they are relative to the current URL as if it were HTML."

Is there a specific index that relies on this broken redirect?

I will propose a PR to fix this.

@juntyr juntyr linked a pull request Apr 6, 2025 that will close this issue
@Carreau
Copy link
Contributor

Carreau commented Apr 6, 2025

if a repo rely on this, it's either pypi, or pypi.anaconda.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants