Skip to content
This repository was archived by the owner on Jun 2, 2024. It is now read-only.

Commit 5ddf238

Browse files
committed
fix typo and dont sync not exists packages
1 parent 1ae193e commit 5ddf238

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

controllers/registry/module.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,9 @@ exports.addPackageAndDist = function *(next) {
480480
var name = this.params.name;
481481
var filename = Object.keys(pkg._attachments || {})[0];
482482
var version = Object.keys(pkg.versions || {})[0];
483-
484483
if (!version || !filename) {
485-
this.status = 403;
486-
this.bdoy = {
484+
this.status = 400;
485+
this.body = {
487486
error: 'version_error',
488487
reason: 'filename or version not found, filename: ' + filename + ', version: ' + version
489488
};

sync/sync_all.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function getMissPackages(callback) {
106106
}
107107

108108
//only sync not exist once
109-
var syncNotExist = true;
109+
var syncNotExist = false;
110110
module.exports = function sync(callback) {
111111
var ep = eventproxy.create();
112112
ep.fail(callback);

test/controllers/registry/module.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ describe('controllers/registry/module.test.js', function () {
406406
.put('/' + pkg.name)
407407
.set('authorization', baseauth)
408408
.send(pkg)
409-
.expect(403, function (err, res) {
409+
.expect(400, function (err, res) {
410410
should.not.exist(err);
411411
res.body.should.eql({
412412
error: 'version_error',

0 commit comments

Comments
 (0)