fix: PDF headers with filename, email download button via protected route
All checks were successful
Staging Build / build (push) Successful in 3m29s

This commit is contained in:
DanielS
2026-07-04 17:50:02 +02:00
parent 80abbfe566
commit 060aa97ce5
3 changed files with 14 additions and 6 deletions

View File

@@ -115,12 +115,13 @@ export async function GET(
const downloadFileName = `Anfragebestaetigung_${order.order_number || id.slice(0, 8)}.pdf`;
const headers = new Headers();
headers.append("Content-Type", "application/pdf");
headers.append("Cache-Control", "private, no-cache");
if (inline) {
headers.append("Content-Disposition", "inline");
headers.append("Content-Disposition", `inline; filename="${downloadFileName}"`);
} else {
headers.append("Content-Disposition", `attachment; filename="${downloadFileName}"`);
}
headers.append("Content-Type", "application/pdf");
return new NextResponse(fileBuffer as any, {
status: 200,

View File

@@ -115,12 +115,13 @@ export async function GET(
const downloadFileName = `Anfragebestaetigung_${order.order_number || id.slice(0, 8)}.pdf`;
const headers = new Headers();
headers.append("Content-Type", "application/pdf");
headers.append("Cache-Control", "private, no-cache");
if (inline) {
headers.append("Content-Disposition", "inline");
headers.append("Content-Disposition", `inline; filename="${downloadFileName}"`);
} else {
headers.append("Content-Disposition", `attachment; filename="${downloadFileName}"`);
}
headers.append("Content-Type", "application/pdf");
return new NextResponse(fileBuffer as any, {
status: 200,