Skip to content

Commit

Permalink
Fix content-type handing for JSON requests (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Jan 3, 2023
1 parent 2c3e9e6 commit ac38f32
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/adguardhome/adguardhome.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ async def request(
self._session = aiohttp.ClientSession()
self._close_session = True

skip_auto_headers = None
if data is None and json_data is None:
skip_auto_headers = {"Content-Type"}

try:
skip_auto_headers = None
if data is None:
skip_auto_headers = {"Content-Type"}
async with async_timeout.timeout(self.request_timeout):
response = await self._session.request(
method,
Expand Down

0 comments on commit ac38f32

Please sign in to comment.