Skip to content

Commit ac38f32

Browse files
authored
Fix content-type handing for JSON requests (#684)
1 parent 2c3e9e6 commit ac38f32

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/adguardhome/adguardhome.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ async def request(
131131
self._session = aiohttp.ClientSession()
132132
self._close_session = True
133133

134+
skip_auto_headers = None
135+
if data is None and json_data is None:
136+
skip_auto_headers = {"Content-Type"}
137+
134138
try:
135-
skip_auto_headers = None
136-
if data is None:
137-
skip_auto_headers = {"Content-Type"}
138139
async with async_timeout.timeout(self.request_timeout):
139140
response = await self._session.request(
140141
method,

0 commit comments

Comments
 (0)