Check explicitly for None

This fixes a bug where a key error would occur if an empty array or dict is passed in
This commit is contained in:
Cedric Wille 2022-05-02 17:40:26 -04:00
parent cdd95b47bc
commit 3aef000228

View file

@ -452,7 +452,7 @@ class HTTPClientMixin:
request_headers = {}
request_headers.setdefault(
'Accept', ', '.join([str(ct) for ct in AVAILABLE_CONTENT_TYPES]))
if body:
if body is not None:
request_headers.setdefault(
'Content-Type',
str(content_type) or str(CONTENT_TYPE_MSGPACK))