Skip to content

Escape package names in pypi/cargo/cocoapods/deno API URLs#16

Open
andrew wants to merge 1 commit intomainfrom
escape-package-names
Open

Escape package names in pypi/cargo/cocoapods/deno API URLs#16
andrew wants to merge 1 commit intomainfrom
escape-package-names

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Apr 8, 2026

npm uses url.PathEscape on package names before building API URLs. These four don't. A package name like requests?evil=1 becomes https://pypi.org/pypi/requests?evil=1/json where ? starts a query string, the path truncates to /pypi/requests, and /json gets eaten by the fragment after #.

Practical impact is low since the worst case is querying a different package than the manifest named, and Go's client normalizes ../ already. But npm got it right and these should match.

Same pattern exists in hex, homebrew, luarocks, nimble, haxelib. Mechanical sweep for those if wanted.

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 this pull request may close these issues.

1 participant