mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
fix: move all actor object urls to immutable variants
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user