After adding frame-src the preview iframe stopped showing the broken-file icon but went blank: it pointed at /api/v1/files/[id]/download, which presigns with the filename so S3 returns Content-Disposition: attachment — the browser downloaded the PDF instead of rendering it. Point the SignedPdfPreview iframe at the existing /preview endpoint, which presigns WITHOUT a filename (inline disposition) so the native PDF viewer renders. Also widen font-src to include https: so react-pdf/pdf.js can load its standard-font pack (LiberationSans*) — previously blocked by font-src 'self' data:, breaking the pdf.js-based viewers' glyphs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6.9 KiB
6.9 KiB