interface HtmlResponseOptions { status?: number; edgeCacheSeconds?: number; } /** * RFC 6266 attachment header. Note slugs may be Japanese, and a raw non-ASCII * byte in a header makes Response throw — so send an ASCII-only `filename` for * old clients plus the real name in `filename*`. */ export function attachmentDisposition(filename: string): string { const ascii = filename.replace(/[^\x20-\x7E]/g, "_").replace(/["\\]/g, "_"); return `attachment; filename="${ascii}"; filename*=UTF-8''${encodeURIComponent(filename)}`; } // Strict CSP: no inline scripts; inline styles allowed for the layout's per-theme