mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-09 18:08:00 +00:00
views.webfinger: return 400 error on missing resource
This commit is contained in:
parent
2b2e311be4
commit
6960c8d6c0
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue