From 28614a0504bd7d76d055fe5ab4866b33ae682f7e Mon Sep 17 00:00:00 2001 From: Guillaume Taquet Gasperini Date: Thu, 2 Apr 2020 13:08:13 +0200 Subject: [PATCH] fix rest platform headers not working headers were of type str, but requests.get expects a dict. This deserializes the headers argument from str to dict (via json). --- dashmachine/platform/rest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dashmachine/platform/rest.py b/dashmachine/platform/rest.py index 307f537..57cb964 100644 --- a/dashmachine/platform/rest.py +++ b/dashmachine/platform/rest.py @@ -59,6 +59,8 @@ class Platform: def __init__(self, *args, **kwargs): # parse the user's options from the config entries for key, value in kwargs.items(): + if key == "headers": + value = json.loads(value) self.__dict__[key] = value # set defaults for omitted options