fix: PDF headers with filename, email download button via protected route
All checks were successful
Staging Build / build (push) Successful in 3m29s
All checks were successful
Staging Build / build (push) Successful in 3m29s
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user