moved HEADER_JSON copy to httpclient

This commit is contained in:
NichtJens
2021-06-01 09:04:43 +02:00
parent db884be531
commit c32aa34bf4
2 changed files with 9 additions and 10 deletions

View File

@ -11,10 +11,10 @@ def authenticated(func):
if not issubclass(type(args[0]), HttpClient):
raise AttributeError("First argument must be an instance of HttpClient")
if "headers" in kwargs:
kwargs["headers"]["Authorization"] = args[0].token
kwargs["headers"] = kwargs["headers"].copy()
else:
kwargs["headers"] = {}
kwargs["headers"]["Authorization"] = args[0].token
kwargs["headers"]["Authorization"] = args[0].token
return func(*args, **kwargs)
return authenticated_call