1
0
مراية لـ https://github.com/postalserver/postal.git تم المزامنة 2025-11-30 21:32:30 +00:00

fix(dkim): fixes bug with signing dkim bodies

هذا الالتزام موجود في:
Adam Cooke
2021-07-28 17:01:42 +00:00
الأصل 21a8d89045
التزام 189dfa509b
4 ملفات معدلة مع 1022 إضافات و5 حذوفات

عرض الملف

@@ -13,7 +13,7 @@ module Postal
end
@domain = domain
@message = message
@raw_headers, @raw_body = @message.split(/\r?\n\r?\n/, 2)
@raw_headers, @raw_body = @message.gsub(/\r?\n/, "\r\n").split(/\r\n\r\n/, 2)
end
def dkim_header
@@ -76,17 +76,18 @@ module Postal
# a. Reduce whitespace
#
# * Reduce all sequences of WSP within a line to a single SP character.
content.gsub!(/[ \t]+/, ' ')
# * Ignore all whitespace at the end of lines. Implementations MUST NOT
# remove the CRLF at the end of the line.
content.gsub!(/ \r\n/, "\r\n")
# * Reduce all sequences of WSP within a line to a single SP character.
content.gsub!(/[ \t]+/, ' ')
# b. Ignore all empty lines at the end of the message body.
content.gsub!(/[ \r\n]*\z/, '')
content += "\r\n"
content
end
end

تم حذف اختلاف الملف لأن الملف كبير جداً تحميل الاختلاف

عرض الملف

@@ -10,7 +10,7 @@ describe Postal::DKIMHeader do
frontmatter, email = contents.split(/^---\n/m, 2)
frontmatter = YAML.load(frontmatter)
email.strip
it "works with #{path.split('/').first}" do
it "works with #{path.split('/').last}" do
mocked_time = Time.at(frontmatter['time'].to_i)
allow(Time).to receive(:now).and_return(mocked_time)