| export function buildContentDisposition(name: string, mediaType?: string): string { | |
| const disposition = /^(image|video|audio)\//.test(mediaType ?? '') ? 'inline' : 'attachment'; | |
| if (/^[\w. ()+[\]-]+$/.test(name)) { | |
| return `${disposition}; filename="${name}"`; | |
| } | |
| return disposition; | |
| } | |