Skip to content

Commit

Permalink
Fix flowed base64 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Weber authored Oct 31, 2017
1 parent 896e3e2 commit c8ea027
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/flowed-decoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class FlowedDecoder extends Transform {
_flush(callback) {
if (this.chunklen) {
let currentBody = Buffer.concat(this.chunks, this.chunklen);

if(this.options.encoding === 'base64') {
currentBody = new Buffer(currentBody.toString('binary'), 'base64');
}

let content = libmime.decodeFlowed(currentBody.toString('binary'), this.options.delSp);
this.push(Buffer.from(content, 'binary'));
}
Expand Down

0 comments on commit c8ea027

Please sign in to comment.