fix: move all actor object urls to immutable variants

This commit is contained in:
Julian Lam
2024-01-29 16:59:13 -05:00
parent 457bfe1685
commit 86a607ce8c
5 changed files with 27 additions and 25 deletions

View File

@@ -94,9 +94,15 @@ Helpers.resolveLocalUid = async (input) => {
const { host, pathname } = new URL(input);
if (host === nconf.get('url_parsed').host) {
return pathname.replace(nconf.get('relative_path'), '').split('/').filter(Boolean)[1];
const [type, value] = pathname.replace(nconf.get('relative_path'), '').split('/').filter(Boolean)[1];
if (type === 'uid') {
return value;
}
slug = value;
} else {
throw new Error('[[error:activitypub.invalid-id]]');
}
throw new Error('[[error:activitypub.invalid-id]]');
} else if (input.indexOf('@') !== -1) { // Webfinger
([slug] = input.replace(/^acct:/, '').split('@'));
} else {