activitypub.actor: handle subdomains vs local domains better

for curl --connect-to
pull/741/head
Ryan Barrett 2023-12-01 12:57:21 -08:00
rodzic a927a59ba9
commit 7dce96d984
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -750,7 +750,6 @@ def postprocess_as2_actor(actor, user=None):
return actor
# source protocol in subdomain.
# WARNING: the user page handler in pages.py overrides this for fediverse
# addresses with leading @ character. be careful when changing this route!
@ -787,7 +786,8 @@ def actor(handle_or_id):
error(f'{cls.LABEL} user {id} not found', status=404)
id = user.id_as(ActivityPub)
if request.url != id: # check that we're serving from the right subdomain
# check that we're serving from the right subdomain
if request.host != urlparse(id).netloc:
return redirect(id)
if not user.obj or not user.obj.as1: