Skip to content

Commit

Permalink
fix: mime type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Sep 12, 2019
1 parent bcaca97 commit a47a799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/message.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ MessageSchema.methods.preValidate = function preValidate(next) {
* @instance
*/
MessageSchema.methods.isHtml = function _isHtml() {
return (this.mime = MIME_HTML) || isHtml(this.body);
return (this.mime === MIME_HTML) || isHtml(this.body);
};

/**
Expand Down
2 changes: 2 additions & 0 deletions test/integration/message.send.smtp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ describe('smtp transport', () => {
expect(sent).to.exist;
expect(sent._id).to.exist;
expect(sent.transport).to.be.equal('smtp');
expect(sent.mime).to.be.equal('text/plain');
expect(sent.isHtml()).to.be.false;
expect(sent.sentAt).to.exist;
expect(sent.deliveredAt).to.exist;
expect(sent.failedAt).to.not.exist;
Expand Down

0 comments on commit a47a799

Please sign in to comment.