mirror of
https://github.com/juherr/kill-the-news.git
synced 2026-06-21 06:13:48 +00:00
feat(attachments): render inline cid images in place, not as attachments
Inline images (referenced by src="cid:…") are now classified at ingest and kept out of the downloadable attachment lists, RSS/Atom enclosures, and the API — while still stored in R2 and cleaned up with the email. Fixes the admin email preview, which injected raw HTML into the data: iframe so cid refs never resolved; it now rewrites them to absolute /files URLs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,9 @@ export async function handle(c: Context<{ Bindings: Env }>): Promise<Response> {
|
||||
"default-src 'none'; style-src 'unsafe-inline'; img-src *; frame-src 'none'",
|
||||
);
|
||||
|
||||
const attachments = emailData.attachments ?? [];
|
||||
// Inline images render in place (cid: refs are rewritten by processEmailContent);
|
||||
// only genuine, downloadable attachments belong in the list below.
|
||||
const attachments = (emailData.attachments ?? []).filter((a) => !a.inline);
|
||||
const attachmentsSection = attachments.length
|
||||
? html`<section class="attachments">
|
||||
<h2>Attachments</h2>
|
||||
|
||||
Reference in New Issue
Block a user