mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-13 22:48:31 -05:00
npm star/unstar calls now return proper error
This commit is contained in:
parent
2675196672
commit
1556ce195a
1 changed files with 9 additions and 0 deletions
|
@ -135,6 +135,15 @@ module.exports = function(config_hash) {
|
||||||
// publishing a package
|
// publishing a package
|
||||||
app.put('/:package', can('publish'), media('application/json'), expect_json, function(req, res, next) {
|
app.put('/:package', can('publish'), media('application/json'), expect_json, function(req, res, next) {
|
||||||
var name = req.params.package;
|
var name = req.params.package;
|
||||||
|
|
||||||
|
if (Object.keys(req.body).length == 1 && typeof(req.body.users) === 'object') {
|
||||||
|
return next(new UError({
|
||||||
|
// 501 status is more meaningful, but npm doesn't show error message for 5xx
|
||||||
|
status: 404,
|
||||||
|
msg: 'npm star|unstar calls are not implemented',
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var metadata = utils.validate_metadata(req.body, name);
|
var metadata = utils.validate_metadata(req.body, name);
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue