mirror of
https://github.com/mailscope/kumomta.git
synced 2026-08-20 11:28:17 +00:00
a006c8ffa0
Our behavior has changed so it is acceptable to change the test expectations. We now return the binary bytes as-is for non-conforming inputs, rather than attempting an implicit and lossy UTF-8 conversion.
25 lines
722 B
Lua
25 lines
722 B
Lua
local kumo = require 'kumo'
|
|
local utils = require 'policy-extras.policy_utils'
|
|
|
|
local function new_msg(content)
|
|
return kumo.make_message('sender@example.com', 'recip@example.com', content)
|
|
end
|
|
|
|
-- 0xA9 is latin-1 for the copyright symbol
|
|
local msg = new_msg 'Subject: \xa9\r\n\r\nGBP'
|
|
|
|
-- We return the latin-1 bytes as-is
|
|
utils.assert_eq(msg:get_first_named_header_value 'subject', '\xa9')
|
|
|
|
msg:check_fix_conformance('', 'NEEDS_TRANSFER_ENCODING', {
|
|
detect_encoding = true,
|
|
include_encodings = {
|
|
'iso-8859-1',
|
|
},
|
|
exclude_encodings = {},
|
|
})
|
|
|
|
-- The result is now the utf-8 form of the latin-1 input,
|
|
-- and the copyright symbol comes through
|
|
utils.assert_eq(msg:get_first_named_header_value 'subject', '©')
|