Skip to content

Commit

Permalink
fix(commands): 502 error on unsupported command (#185)
Browse files Browse the repository at this point in the history
* fix(commands): 502 error on unsupported command

Fixes: #184

* test: update test assertion
  • Loading branch information
trs authored Jan 6, 2020
1 parent 81fa7fc commit b2b1b2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FtpCommands {
log.trace({command: logCommand}, 'Handle command');

if (!REGISTRY.hasOwnProperty(command.directive)) {
return this.connection.reply(402, 'Command not allowed');
return this.connection.reply(502, 'Command not allowed');
}

if (_.includes(this.blacklist, command.directive)) {
Expand Down
2 changes: 1 addition & 1 deletion test/commands/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('FtpCommands', function () {
return commands.handle('bad')
.then(() => {
expect(mockConnection.reply.callCount).to.equal(1);
expect(mockConnection.reply.args[0][0]).to.equal(402);
expect(mockConnection.reply.args[0][0]).to.equal(502);
});
});

Expand Down

0 comments on commit b2b1b2a

Please sign in to comment.