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')
|
@register_route('GET', '/.well-known/webfinger')
|
||||||
async def webfinger(request):
|
async def webfinger(request):
|
||||||
|
try:
|
||||||
subject = request.query['resource']
|
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}':
|
if subject != f'acct:relay@{request.app.config.host}':
|
||||||
return Response.new_error(404, 'user not found', 'json')
|
return Response.new_error(404, 'user not found', 'json')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue