]> git.ipfire.org Git - thirdparty/patchwork.git/commit
mbox: do not copy Content-Type into exported mbox
authorDaniel Axtens <dja@axtens.net>
Wed, 21 Aug 2019 05:15:44 +0000 (15:15 +1000)
committerDaniel Axtens <dja@axtens.net>
Thu, 22 Aug 2019 11:33:00 +0000 (21:33 +1000)
commitdde885c6c2f5e03388630320bc03a4cbe1040c64
treefab8e001f83f691b7cbb6df1641d5035ba1eeaff
parent9a0b59925135a5c246942bf0fd6787e0e200b5ac
mbox: do not copy Content-Type into exported mbox

Daniel reports a patch + comment combination that breaks in
git am. The patch reports a Content-Type of US-ASCII, while
the comment adds a Ack with UTF-8 characters. The exported
mbox contains both the original Content-Type, and a UTF-8
Content-Type that we set. However, because the US-ASCII one
occurs later, git am honours it instead of ours, and chokes
on the UTF-8 characters.

Strip out any subsequent Content-Type:s. We normalise things
to UTF-8 and should not allow it to be overridden.

Add a test for this, based on the original report.

Reported-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Axtens <dja@axtens.net>
patchwork/tests/series/bugs-multiple-content-types.mbox [new file with mode: 0644]
patchwork/tests/test_series.py
patchwork/views/utils.py