From 2b11d0522c0edd712f0010cc6f024b87a0d629e1 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 10 Aug 2018 21:24:23 -0500 Subject: [PATCH] fix content type --- viera/actor.py | 2 +- viera/http_signatures.py | 2 +- viera/remote_actor.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/viera/actor.py b/viera/actor.py index c1355cd..a63a9a4 100644 --- a/viera/actor.py +++ b/viera/actor.py @@ -118,7 +118,7 @@ processors = { async def inbox(request): - data = await request.json(content_type=None) + data = await request.json() if 'actor' not in data or not request['validated']: raise aiohttp.web.HTTPUnauthorized(body='access denied', content_type='text/plain') diff --git a/viera/http_signatures.py b/viera/http_signatures.py index 0cba6d7..9c6f81a 100644 --- a/viera/http_signatures.py +++ b/viera/http_signatures.py @@ -102,7 +102,7 @@ async def http_signatures_middleware(app, handler): request['validated'] = False if 'signature' in request.headers: - data = await request.json(content_type=None) + data = await request.json() if 'actor' not in data: raise aiohttp.web.HTTPUnauthorized(body='signature check failed, no actor in message') diff --git a/viera/remote_actor.py b/viera/remote_actor.py index d1862f9..14d2db3 100644 --- a/viera/remote_actor.py +++ b/viera/remote_actor.py @@ -9,6 +9,6 @@ async def fetch_actor(uri, force=False): async with aiohttp.ClientSession() as session: 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 return ACTORS[uri]