Changeset 98688c6 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/26/2026 10:23:33 AM (2 months ago)
- Branches:
- main
- Children:
- 5783c67
- Parents:
- cbe4f4e
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rcbe4f4e r98688c6 1160 1160 const base = (process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, ''); 1161 1161 if (!base || !site || !site.slug) return { error: 'config' }; 1162 // Accept either an @user@host handle (WebFinger) or a profile/actor URL directly 1163 // (the authorize_interaction Follow flow passes a URL). 1162 // Accept any of: a profile/actor URL, an @user@host handle (WebFinger), or a 1163 // bare site domain (site.com) — for a single-actor site (Klonkt etc.) the root 1164 // resolves to its AP actor, so you can follow a site by just its domain. 1164 1165 const s = String(handle || '').trim(); 1165 const actorUrl = /^https?:\/\//i.test(s) ? (safeUrl(s) || null) : await webfingerResolve(s); 1166 let actorUrl; 1167 if (/^https?:\/\//i.test(s)) actorUrl = safeUrl(s) || null; 1168 else if (s.includes('@')) actorUrl = await webfingerResolve(s); 1169 else if (/^[a-z0-9.-]+\.[a-z]{2,}/i.test(s)) actorUrl = await resolveApActor('https://' + s.replace(/^\/+|\/+$/g, '')); 1170 else actorUrl = null; 1166 1171 if (!actorUrl) return { error: 'not_found' }; 1167 1172 const actor = await fetchActor(actorUrl).catch(() => null);
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)