mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -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
|
||||
app.put('/:package', can('publish'), media('application/json'), expect_json, function(req, res, next) {
|
||||
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 {
|
||||
var metadata = utils.validate_metadata(req.body, name);
|
||||
} catch(err) {
|
||||
|
|
Loading…
Reference in a new issue