mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 23:26:42 +00:00
still tweaking webfinger syntax
This commit is contained in:
parent
65371d6904
commit
4b7de93c90
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue