fix: update secure checks
This commit is contained in:
@@ -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');
|
||||
},
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user