]> git.ipfire.org Git - thirdparty/patchwork.git/commit
api: Show all headers with the same key
authorVeronika Kabatova <vkabatov@redhat.com>
Fri, 6 Apr 2018 11:24:49 +0000 (13:24 +0200)
committerStephen Finucane <stephen@that.guru>
Wed, 25 Apr 2018 20:04:23 +0000 (21:04 +0100)
commit608f7bda1f93d451aee244821f5e1ed57df2b23a
tree4e30b84aced892c3088a338a0c3b9a565b1c6a18
parent849e47f48b13d6cb7a918cc001be232654fde124
api: Show all headers with the same key

While the code on our side returns all (key, value) pairs for email
headers, Django's REST framework probably uses dictionaries behind the
scenes. This means that having multiple headers with same key (eg
'Received', which is totally valid and common situation), only one of
these headers is visible in the REST API.

Let's hack around this by returning a list of values in case the key is
present multiple times.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/api/cover.py
patchwork/api/patch.py
patchwork/tests/api/test_cover.py
patchwork/tests/api/test_patch.py