diff --git a/src/app/api/pb-files/[collection]/[recordId]/[...filename]/route.ts b/src/app/api/pb-files/[collection]/[recordId]/[...filename]/route.ts new file mode 100644 index 0000000..b768cae --- /dev/null +++ b/src/app/api/pb-files/[collection]/[recordId]/[...filename]/route.ts @@ -0,0 +1,109 @@ +import { NextResponse } from "next/server"; + +/** + * GET /api/pb-files/[collection]/[recordId]/[...filename] + * + * Same-origin proxy for PocketBase file responses, so the dashboard + * iframe can render PDF slips without the cross-origin + * `Content-Security-Policy: ...sandbox` header that PocketBase sets + * on `/api/files/...`. That CSP makes the response opaque-origin and + * Chromium's PDF viewer silently fails to render the PDF in an + * `