Skip to content

Commit

Permalink
Possibility to send back empty message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortens4444 authored and trs committed Aug 22, 2019
1 parent a1c7f2f commit 290769a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ class FtpConnection extends EventEmitter {
else if (typeof letter === 'string') letter = {message: letter}; // allow passing in message as first param

if (!letter.socket) letter.socket = options.socket ? options.socket : this.commandSocket;
if (!letter.message) letter.message = DEFAULT_MESSAGE[options.code] || 'No information';
if (!letter.encoding) letter.encoding = this.encoding;
if (!options.useEmptyMessage) {
if (!letter.message) letter.message = DEFAULT_MESSAGE[options.code] || 'No information';
if (!letter.encoding) letter.encoding = this.encoding;
}
return Promise.resolve(letter.message) // allow passing in a promise as a message
.then((message) => {
const seperator = !options.hasOwnProperty('eol') ?
Expand Down

0 comments on commit 290769a

Please sign in to comment.