views.webfinger: return 400 error on missing resource

This commit is contained in:
Izalia Mae 2022-11-18 11:50:12 -05:00
parent 2b2e311be4
commit 6960c8d6c0

View file

@ -140,7 +140,11 @@ async def inbox(request):
@register_route('GET', '/.well-known/webfinger')
async def webfinger(request):
subject = request.query['resource']
try:
subject = request.query['resource']
except KeyError:
return Response.new_error(400, 'missing \'resource\' query key', 'json')
if subject != f'acct:relay@{request.app.config.host}':
return Response.new_error(404, 'user not found', 'json')