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
Publish new package throw error when uplink set to https://registry.npmmirror.com
(cnpm registry)
#3601
Comments
Hi, Please be detailed and specific, add examples so I can understand exactly what's the issue in few minutes. |
OK! Thanks so much! @juanpicado Your Environment
Describe the bugThe registry https://registry.npmmirror.com will return a 413 status code for a GET request containing a request body, which will cause an error when publishing a new package, resulting in a failure to publish. On the other hand, a GET request should not contain a request body. To Reproduce1. Update config fileuplinks:
npmjs:
url: https://registry.npmjs.org
cnpmjs:
url: https://registry.npmmirror.com packages:
"**":
access: $all
publish: $authenticated
unpublish: $authenticated
proxy: cnpmjs 2. Publish a new package named
|
I got the same issue. |
When making a GET request to certain uplinks, such as https://registry.npmmirror.com, setting the body field can result in a 413 error. Previously, the code was setting the body field for all requests, including GET requests. This commit fixes the issue by checking the request method and avoiding setting the body field for GET requests. This ensures that GET requests are not affected by the issue and can be made without error. Fixes verdaccio#3601
…en input is a boolean This bug will case [request](https://github.com/verdaccio/verdaccio/blob/bae430fe24c9bb63dcf7b7b9e5f9f0dbf3f42669/src/lib/up-storage.ts#L157) has a body when options.json is `true`. fix verdaccio#3601
Cause thers is a bug in `isObject` function from `@verdaccio/core`, when `options.json` is `true` GET request body will be string 'true', some uplinks might return 413 status code such as https://registry.npmmirror.com fix verdaccio#3601
* fix: avoid setting body for GET requests When making a GET request to certain uplinks, such as https://registry.npmmirror.com, setting the body field can result in a 413 error. Previously, the code was setting the body field for all requests, including GET requests. This commit fixes the issue by checking the request method and avoiding setting the body field for GET requests. This ensures that GET requests are not affected by the issue and can be made without error. Fixes #3601 * add missing deps for run test locally * test(up-storage): add unit test about uplink is npmmirror Cause thers is a bug in `isObject` function from `@verdaccio/core`, when `options.json` is `true` GET request body will be string 'true', some uplinks might return 413 status code such as https://registry.npmmirror.com fix #3601 * chore(deps): update @verdaccio/core --------- Co-authored-by: Juan Picado <juanpicado19@gmail.com> Co-authored-by: botao <botao@tal.com>
The registry
https://registry.npmmirror.com
will return a 413 status code for a GET request containing a request body, which will cause an error when publishing a new package, resulting in a failure to publish.On the other hand, a GET request should not contain a request body.
The text was updated successfully, but these errors were encountered: