]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
skip original Content-Transfer-Encoding for mbox
authorYuri Volchkov <yuri.volchkov@gmail.com>
Mon, 7 May 2018 15:57:55 +0000 (01:57 +1000)
committerStephen Finucane <stephen@that.guru>
Tue, 8 May 2018 08:20:59 +0000 (09:20 +0100)
In the commit 01b9cbb9 all original mail headers are copied into the
resulted mbox file. This means that some headers are going to be
present twice in the generated mbox. That is fine unless the original
email arrived in base64 encoding.

Apparently git relies on the latest Content-Transfer-Encoding key. And
since downloaded patch's actual encoding is '7bit', git fails to apply
it with the message 'Patch is empty'.

Since patchwork adds a proper 'Content-Transfer-Encoding' anyways,
let's skip this field while copying headers from the original mail

Signed-off-by: Yuri Volchkov <yuri.volchkov@gmail.com>
Acked-by: Veronika Kabatova <vkabatov@redhat.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/views/utils.py

index f5ff43c169ffbb119faf957e50bdbcef50d6bd77..2357ab86d46cc03171bc037378d2d399033f8e6d 100644 (file)
@@ -99,6 +99,8 @@ def _submission_to_mbox(submission):
 
     orig_headers = HeaderParser().parsestr(str(submission.headers))
     for key, val in orig_headers.items():
+        if key == 'Content-Transfer-Encoding':
+            continue
         mail[key] = val
 
     if 'Date' not in mail: