From 005999fcb9f06e806e00920e7bee37a74ff638ca Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sat, 11 Jul 2020 04:17:34 +0000 Subject: [PATCH] Disable aiohttp's Content-Type checking on JSON parsing by default --- qwarc/aiohttp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qwarc/aiohttp.py b/qwarc/aiohttp.py index a1e407f..931a7f0 100644 --- a/qwarc/aiohttp.py +++ b/qwarc/aiohttp.py @@ -175,6 +175,11 @@ class ClientResponse(aiohttp.client_reqrep.ClientResponse): self._content = await self._read() return self._content + async def json(self, **kwargs): + if 'content_type' not in kwargs: + kwargs['content_type'] = None + return (await super().json(**kwargs)) + async def release(self): if not self.closed: self.connection.reset_raw_data()