const contentDispositionRegex = /filename=["']?([^"']+?)["']/gmi; export function getFileNameFromContentDispositionHeader(headerValue: string) { const match = Array.from(String(headerValue).matchAll(contentDispositionRegex))[0]; return match ? decodeURIComponent(match[1]) : "file.dat"; }
695100cookie-checkTypescript parse content-disposition header