Skip to content

Commit

Permalink
fix: fix header passing in __open
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Jan 31, 2021
1 parent f4b8988 commit f193c64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ async def __open(
url: Text,
method: Text = "get",
headers=None,
cookies=None,
data=None,
baseurl: Text = "",
) -> None:
"""Open url."""
headers = headers or {}
cookies = cookies or {}
if not baseurl:
baseurl = self.baseurl
url: URL = URL(baseurl + url)
Expand All @@ -148,7 +150,7 @@ async def __open(

try:
resp = await getattr(self.websession, method)(
url, headers=headers, data=data
url, data=data, headers=headers, cookies=cookies
)
data = await resp.json()
_LOGGER.debug("%s: %s", resp.status, json.dumps(data))
Expand Down

0 comments on commit f193c64

Please sign in to comment.