my website at ewancroft.uk
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: add fallback

+7 -2
+7 -2
src/routes/.well-known/webfinger/+server.ts
··· 12 12 throw error(501, 'ActivityPub not configured'); 13 13 } 14 14 15 - const resource = url.searchParams.get('resource'); 15 + const rawResource = url.searchParams.get('resource'); 16 16 17 - if (!resource) { 17 + if (!rawResource) { 18 18 throw error(400, 'Missing resource parameter'); 19 19 } 20 + 21 + // Normalise acct: URIs — strip a leading '@' from the user part if present. 22 + // Some clients (e.g. webfinger.net lookup tool) send acct:@user@host instead 23 + // of the correct acct:user@host form per RFC 7565. 24 + const resource = rawResource.replace(/^acct:@/, 'acct:'); 20 25 21 26 const instanceDomain = new URL(apInstanceUrl).hostname; 22 27 const siteDomain = new URL(PUBLIC_SITE_URL).hostname;