diff --git a/lib/index.js b/lib/index.js index 2f8f5d3b1..343e179de 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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) {