fix: update secure checks
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
directive: 'PBSZ',
|
directive: 'PBSZ',
|
||||||
handler: function ({command} = {}) {
|
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);
|
this.bufferSize = parseInt(command.arg, 10);
|
||||||
return this.reply(200, this.bufferSize === 0 ? 'OK' : 'Buffer too large: PBSZ=0');
|
return this.reply(200, this.bufferSize === 0 ? 'OK' : 'Buffer too large: PBSZ=0');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ const _ = require('lodash');
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
directive: 'PROT',
|
directive: 'PROT',
|
||||||
handler: function ({command} = {}) {
|
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');
|
||||||
if (this.bufferSize === false) return this.reply(503);
|
if (!this.bufferSize && typeof this.bufferSize !== 'number') return this.reply(503);
|
||||||
|
|
||||||
switch (_.toUpper(command.arg)) {
|
switch (_.toUpper(command.arg)) {
|
||||||
case 'P': return this.reply(200, 'OK');
|
case 'P': return this.reply(200, 'OK');
|
||||||
|
|||||||
Reference in New Issue
Block a user