Skip to content

Commit 741f99f

Browse files
committed
Delete starting empty line
When header is empty it shouldn't add an starting empty new line
1 parent ebb8b70 commit 741f99f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rex/mime/message.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ def add_part_inline_attachment(data, name)
125125
end
126126

127127
def to_s
128-
msg = force_crlf(self.header.to_s + "\r\n")
128+
header_string = self.header.to_s
129+
130+
if header_string.empty?
131+
msg = ''
132+
else
133+
msg = force_crlf(self.header.to_s + "\r\n")
134+
end
129135

130136
unless self.content.blank?
131137
msg << force_crlf(self.content + "\r\n")

0 commit comments

Comments
 (0)