]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
parser: Strip whitespace from references
authorStephen Finucane <stephen@that.guru>
Wed, 24 May 2017 05:54:55 +0000 (06:54 +0100)
committerStephen Finucane <stephen@that.guru>
Tue, 30 May 2017 20:08:52 +0000 (21:08 +0100)
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 <stephen@that.guru>
patchwork/parser.py

index 28b3a072558e1e58867c2a5be6739424e1a36362..f56053b8aa5141291a5fc6fb74358ab100580abf 100644 (file)
@@ -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)