-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
NPM Package Registry returns HTTP400 for packages with single-character names #26551
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
Comments
Additional information:
|
Should check/test that regex. This package may be a good starting point: |
- Added new tests to cover corner cases - Replace existing regex with new one Closes #26551 --- As @silverwind suggested, I started from [validate-npm-package-name](https://github.com/npm/validate-npm-package-name), but found this solution too complicated. Then I tried to fix existing regex myself, but thought, that exclude all restricted symbols is harder, than set only allowed symbols. Then I search a bit more and found [package-name-regex](https://github.com/dword-design/package-name-regex) and regex from it works for all new test cases. Let me know, if more information or help with this PR is needed.
- Added new tests to cover corner cases - Replace existing regex with new one Closes go-gitea#26551 --- As @silverwind suggested, I started from [validate-npm-package-name](https://github.com/npm/validate-npm-package-name), but found this solution too complicated. Then I tried to fix existing regex myself, but thought, that exclude all restricted symbols is harder, than set only allowed symbols. Then I search a bit more and found [package-name-regex](https://github.com/dword-design/package-name-regex) and regex from it works for all new test cases. Let me know, if more information or help with this PR is needed.
Description
Steps to reproduce the issue:
npm i q
in environment from previous stepIt'll download
https://www.npmjs.com/package/q/v/1.5.1
as your dependency and put it in./node_modules/q/
directory.npm publish ./node_modules/q/
to publish this package to Gitea.Error from Gitea log
Gitea Version
3b129aa
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
2.40.1
Operating System
Ubuntu 22.04
How are you running Gitea?
Gitea running in docker.
Docker version:
With docker-compose version:
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: