]> git.ipfire.org Git - thirdparty/patchwork.git/commit
parser: deal with headers entirely failing to parse
authorDaniel Axtens <dja@axtens.net>
Wed, 28 Jun 2017 07:48:47 +0000 (17:48 +1000)
committerStephen Finucane <stephen@that.guru>
Wed, 28 Jun 2017 20:41:28 +0000 (21:41 +0100)
commita128310bfa1c34aaba832fd488213005f2ba997c
tree6df55e975636e88179d61f3f9f6849e17e50398c
parent66131ed2ce12c9fe00c294514743480a5ac47bd5
parser: deal with headers entirely failing to parse

It turns out that the attempts in clean_header() to convert
headers to strings are not guaranteed to work: you can end up with,
for example, a base64 decoding error which makes it impossible
to determine any header content.

In this case, sanitise_header() should return None, and thus
clean_header() should return None. We then need to plumb that
through.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
patchwork/parser.py