From 6763667ffc1012bd544d2b08d342c4a5abef80d9 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 24 May 2017 06:54:55 +0100 Subject: [PATCH] parser: Strip whitespace from references Some mail, particularly those generated with older versions of git-send-email or written by hand, include some extra whitespace in the 'References' and 'In-Reply-To' lines. Ensure we always strip this, preventing mismatches between this and 'Message-ID', which is already stripped of whitespace, when looking up SeriesReference's. Signed-off-by: Stephen Finucane --- patchwork/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/patchwork/parser.py b/patchwork/parser.py index 28b3a072..f56053b8 100644 --- a/patchwork/parser.py +++ b/patchwork/parser.py @@ -339,12 +339,13 @@ def find_references(mail): refs = [] if 'In-Reply-To' in mail: - refs.append(mail.get('In-Reply-To')) + refs.append(mail.get('In-Reply-To').strip()) if 'References' in mail: rs = mail.get('References').split() rs.reverse() for r in rs: + r = r.strip() if r not in refs: refs.append(r) -- 2.47.3