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