still tweaking webfinger syntax

This commit is contained in:
Mouse Reeve 2020-11-01 12:29:31 -08:00
parent 65371d6904
commit 4b7de93c90
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ def handle_remote_webfinger(query):
try:
user = models.User.objects.get(username=query)
except models.User.DoesNotExist:
url = 'https://%s/.well-known/webfinger?resource=acct:@%s' % \
url = 'https://%s/.well-known/webfinger?resource=acct:%s' % \
(domain, query)
try:
response = requests.get(url)

View file

@ -19,14 +19,14 @@ def webfinger(request):
if not resource and not resource.startswith('acct:'):
return HttpResponseNotFound()
username = resource.replace('acct:@', '')
username = resource.replace('acct:', '')
try:
user = models.User.objects.get(username=username)
except models.User.DoesNotExist:
return HttpResponseNotFound('No account found')
return JsonResponse({
'subject': 'acct:@%s' % (user.username),
'subject': 'acct:%s' % (user.username),
'links': [
{
'rel': 'self',