mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-01-01 11:32:04 +00:00
Ignore content type checking for aiohttp
Pass content_type=None as per the document suggests: https://docs.aiohttp.org/en/stable/client_advanced.html#disabling-content-type-validation-for-json-responses
This commit is contained in:
parent
c966e6faf8
commit
e3d62d4169
@ -13,7 +13,7 @@ def simple_json(urlpat, confkey, version_from_json):
|
||||
kwargs["proxy"] = conf.get('proxy')
|
||||
|
||||
async with session.get(url, **kwargs) as res:
|
||||
data = await res.json()
|
||||
data = await res.json(content_type=None)
|
||||
version = version_from_json(data)
|
||||
return version
|
||||
|
||||
|
@ -64,7 +64,7 @@ class ResponseManager:
|
||||
async def __aexit__(self, exc_type, exc, tb):
|
||||
pass
|
||||
|
||||
async def json_response(self):
|
||||
async def json_response(self, **kwargs):
|
||||
return json.loads(self.body.decode('utf-8'))
|
||||
|
||||
async def read(self):
|
||||
|
Loading…
Reference in New Issue
Block a user