Skip to content

Commit

Permalink
Fixed a bug where adding custom functions to Object.prototype resulte…
Browse files Browse the repository at this point in the history
…d with the source of these functions to be outputted in the mail headers. Worse, if the function contained a blank line, the line will be interpreted as the end of the headers zone resulting in some headers being outputted in the mail body (!).
  • Loading branch information
Tuetuopay committed Jan 12, 2016
1 parent 452d2ef commit 5e3f5a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smtp/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ var MessageStream = function(message)

for(var header in self.message.header)
{
// do not output BCC in the headers...
if(!(/bcc/i.test(header)))
// do not output BCC in the headers (regex) nor custom Object.prototype functions...
if(!(/bcc/i.test(header)) && self.message.header.hasOwnProperty (header))
data = data.concat([fix_header_name_case(header), ": ", self.message.header[header], CRLF]);
}

Expand Down

0 comments on commit 5e3f5a9

Please sign in to comment.