Skip to content

Commit b2b1b2a

Browse files
authored
fix(commands): 502 error on unsupported command (#185)
* fix(commands): 502 error on unsupported command Fixes: #184 * test: update test assertion
1 parent 81fa7fc commit b2b1b2a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/commands/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FtpCommands {
4545
log.trace({command: logCommand}, 'Handle command');
4646

4747
if (!REGISTRY.hasOwnProperty(command.directive)) {
48-
return this.connection.reply(402, 'Command not allowed');
48+
return this.connection.reply(502, 'Command not allowed');
4949
}
5050

5151
if (_.includes(this.blacklist, command.directive)) {

test/commands/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe('FtpCommands', function () {
9090
return commands.handle('bad')
9191
.then(() => {
9292
expect(mockConnection.reply.callCount).to.equal(1);
93-
expect(mockConnection.reply.args[0][0]).to.equal(402);
93+
expect(mockConnection.reply.args[0][0]).to.equal(502);
9494
});
9595
});
9696

0 commit comments

Comments
 (0)