]> 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>
Fri, 23 Aug 2019 05:00:10 +0000 (15:00 +1000)
commit6a716c4267dfbb0122fb20071b70ff560bef3b3a
treec8ebf3d6b95cfeba3ff8c61b3eec9ac805cdfb0e
parentb4592c96704f656475b93afbb801991b71ba411b
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