fix content type
This commit is contained in:
parent
e5597399b6
commit
2b11d0522c
|
@ -118,7 +118,7 @@ processors = {
|
||||||
|
|
||||||
|
|
||||||
async def inbox(request):
|
async def inbox(request):
|
||||||
data = await request.json(content_type=None)
|
data = await request.json()
|
||||||
|
|
||||||
if 'actor' not in data or not request['validated']:
|
if 'actor' not in data or not request['validated']:
|
||||||
raise aiohttp.web.HTTPUnauthorized(body='access denied', content_type='text/plain')
|
raise aiohttp.web.HTTPUnauthorized(body='access denied', content_type='text/plain')
|
||||||
|
|
|
@ -102,7 +102,7 @@ async def http_signatures_middleware(app, handler):
|
||||||
request['validated'] = False
|
request['validated'] = False
|
||||||
|
|
||||||
if 'signature' in request.headers:
|
if 'signature' in request.headers:
|
||||||
data = await request.json(content_type=None)
|
data = await request.json()
|
||||||
if 'actor' not in data:
|
if 'actor' not in data:
|
||||||
raise aiohttp.web.HTTPUnauthorized(body='signature check failed, no actor in message')
|
raise aiohttp.web.HTTPUnauthorized(body='signature check failed, no actor in message')
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,6 @@ async def fetch_actor(uri, force=False):
|
||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get(uri, headers={'Accept': 'application/activity+json'}) as resp:
|
async with session.get(uri, headers={'Accept': 'application/activity+json'}) as resp:
|
||||||
ACTORS[uri] = (await resp.json())
|
ACTORS[uri] = (await resp.json(content_type=None))
|
||||||
DATABASE["actors"] = ACTORS
|
DATABASE["actors"] = ACTORS
|
||||||
return ACTORS[uri]
|
return ACTORS[uri]
|
||||||
|
|
Loading…
Reference in a new issue