fix: don't look up webfinger when it's not necessary

This commit is contained in:
Opliko
2024-04-25 19:58:55 +02:00
parent ee6779445b
commit dd71340af9

View File

@@ -31,8 +31,8 @@ Actors.assert = async (ids, options = {}) => {
// Translate webfinger handles to uris
ids = (await Promise.all(ids.map(async (id) => {
const originalId = id;
if (id.includes('@')) {
const isUri = activitypub.helpers.isUri(id);
if (id.includes('@') || isUri) {
const host = isUri ? new URL(id).host : id.split('@')[1];
if (host === nconf.get('url_parsed').host) { // do not assert loopback ids
return null;