Bob Mottram 2022-08-27 20:10:38 +01:00
parent 965208495a
commit ca96504528
3 changed files with 8 additions and 3 deletions

View File

@ -147,7 +147,10 @@ def get_person_pub_key(base_dir: str, session, person_url: str,
"""
if not person_url:
return None
person_url = person_url.replace('#main-key', '')
if '#/publicKey' in person_url:
person_url = person_url.replace('#/publicKey', '')
else:
person_url = person_url.replace('#main-key', '')
users_paths = get_user_paths()
for possible_users_path in users_paths:
if person_url.endswith(possible_users_path + 'inbox'):

View File

@ -709,7 +709,7 @@ class PubServer(BaseHTTPRequestHandler):
if signature_item.startswith('keyId='):
if '"' in signature_item:
key_id = signature_item.split('"')[1]
# remove #main-key
# remove #/main-key or #main-key
if '#' in key_id:
key_id = key_id.split('#')[0]
return key_id

View File

@ -921,7 +921,9 @@ def add_alternate_domains(actor_json: {}, domain: str,
def person_lookup(domain: str, path: str, base_dir: str) -> {}:
"""Lookup the person for an given nickname
"""
if path.endswith('#main-key'):
if path.endswith('#/publicKey'):
path = path.replace('#/publicKey', '')
elif path.endswith('#main-key'):
path = path.replace('#main-key', '')
# is this a shared inbox lookup?
is_shared_inbox = False