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,8 +140,12 @@ async def inbox(request):
@register_route('GET', '/.well-known/webfinger')
async def webfinger(request):
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')