diff --git a/js/extension/utils/download.js b/js/extension/utils/download.js index a4f23e5..6072935 100644 --- a/js/extension/utils/download.js +++ b/js/extension/utils/download.js @@ -1,6 +1,5 @@ import axios from '@mapstore/libs/ajax'; - export const toDownload = ({ fileName, mimeType }) => (response) => { const dataUrl = window.URL.createObjectURL(new Blob([response.data], { type: mimeType })); const link = document.createElement('a'); @@ -28,7 +27,7 @@ export function downloadResponse(response, { fileName = 'unknown' } = {}) { if (contentDisposition) { const fileNameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/); if (fileNameMatch.length > 2 && fileNameMatch[1]) { - name = fileNameMatch[1]; + name = fileNameMatch[1].replace(/['"]/g, ''); } } link.setAttribute('download', name);