fix(pdf): sanitise Content-Disposition filename, fix triagedByName test fixture
This commit is contained in:
@@ -146,7 +146,8 @@ export async function GET(
|
||||
closedAt: incident.closedAt instanceof Date ? incident.closedAt.toISOString() : (incident.closedAt as string | null),
|
||||
})
|
||||
|
||||
const filename = `incident-report-${incident.referenceNo ?? id}.pdf`
|
||||
const safeRef = (incident.referenceNo ?? id).replace(/[^A-Za-z0-9\-_.]/g, '_')
|
||||
const filename = `incident-report-${safeRef}.pdf`
|
||||
|
||||
return new NextResponse(Buffer.from(pdfBytes), {
|
||||
status: 200,
|
||||
|
||||
Reference in New Issue
Block a user