RFC2822 states that long headers can be wrapped using CRLF followed by
WSP [1]. For example:
Subject: Foo bar,
baz
Should be parsed as:
Foo bar,baz
While we were stripping the former, we were not stripping the
latter. This mean that we ended up with the following:
Foo bar, baz
Resolve this.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #197
(cherry picked from commit
841f966b8d54b2f51ab1c498eed6e5391f2546a9)
def normalise_space(value):
+ value = ''.join(re.split(r'\n\s+', value))
whitespace_re = re.compile(r'\s+')
return whitespace_re.sub(' ', value).strip()
self.assertEqual(clean_subject('[PATCH] meep'), ('meep', []))
self.assertEqual(clean_subject("[PATCH] meep \n meep"),
('meep meep', []))
+ self.assertEqual(clean_subject("[PATCH] meep,\n meep"),
+ ('meep,meep', []))
self.assertEqual(clean_subject('[PATCH RFC] meep'),
('[RFC] meep', ['RFC']))
self.assertEqual(clean_subject('[PATCH,RFC] meep'),
--- /dev/null
+---
+fixes:
+ - |
+ Long headers can be wrapped using CRLF followed by WSP (whitespace). This
+ whitespace was not being stripped, resulting in errant whitespace being
+ saved for the patch subject. This is resolved though existing patches and
+ cover letters will need to be updated manually.