Changeset d3a1abd in Klonkt
- Timestamp:
- 07/30/2026 09:22:06 AM (6 weeks ago)
- Branches:
- main
- Children:
- a9da2c0
- Parents:
- aa189d1
- Files:
-
- 2 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
-
test/c2s-compose.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
raa189d1 rd3a1abd 400 400 } 401 401 body = body.replace(/<img\b[^>]*>/gi, ''); 402 // Video and audio tags leave the federated content the same way (30-7): 403 // they ride as AS2 attachments (c2s_attachments), and the tag itself 404 // carries a RELATIVE /media src that is dead everywhere but our own web. 405 // Leaving it in showed every remote reader a broken player above the 406 // working one. The web keeps its tags: this strip is federation-only. 407 body = body.replace(/<video\b[^>]*>[\s\S]*?<\/video>/gi, '').replace(/<video\b[^>]*\/?>/gi, ''); 408 body = body.replace(/<audio\b[^>]*>[\s\S]*?<\/audio>/gi, '').replace(/<audio\b[^>]*\/?>/gi, ''); 402 409 // Audio shortcodes: do NOT federate the raw audio file — Klonkt deliberately 403 410 // gates audio (the /audio/stream URL has friction), and shipping it as an AP -
test/c2s-compose.test.js
raa189d1 rd3a1abd 44 44 45 45 const note = AP.buildNote('https://test.example', site, post); 46 // The FEDERATED content carries no media tags: they ride as attachments, 47 // and the tags' relative /media srcs are dead everywhere but our own web. 48 // Leaving them in showed every remote reader a broken player above the 49 // working one (Robins schermafdruk, 30-7). 50 assert.ok(!/<(video|audio|img)\b/i.test(note.content), 'the note content is clean of media tags'); 46 51 const att = note.attachment || []; 47 52 const img = att.find((a) => a.url.endsWith('/media/reply-media/foto.jpg'));
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)