fix: update secure checks

This commit is contained in:
Tyler Stewart
2017-05-12 11:50:43 -06:00
parent 73274191fe
commit df0a4d640c
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
module.exports = {
directive: 'PBSZ',
handler: function ({command} = {}) {
if (!this.server._tls) return this.reply(202, 'Not suppored');
if (!this.server._tls || !this.secure) return this.reply(202, 'Not suppored');
this.bufferSize = parseInt(command.arg, 10);
return this.reply(200, this.bufferSize === 0 ? 'OK' : 'Buffer too large: PBSZ=0');
},

View File

@@ -3,8 +3,8 @@ const _ = require('lodash');
module.exports = {
directive: 'PROT',
handler: function ({command} = {}) {
if (!this.server._tls) return this.reply(202, 'Not suppored');
if (this.bufferSize === false) return this.reply(503);
if (!this.server._tls || !this.secure) return this.reply(202, 'Not suppored');
if (!this.bufferSize && typeof this.bufferSize !== 'number') return this.reply(503);
switch (_.toUpper(command.arg)) {
case 'P': return this.reply(200, 'OK');