From aab002fdfc667c65e3ac3ca05d736f4f1f46508c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20J=C3=A9go?= Date: Thu, 24 Feb 2022 15:08:11 +0100 Subject: [PATCH 1/2] remove duplicated quote to remove underscore create by browser --- js/extension/utils/download.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/extension/utils/download.js b/js/extension/utils/download.js index a4f23e5..1cfa7ca 100644 --- a/js/extension/utils/download.js +++ b/js/extension/utils/download.js @@ -1,4 +1,5 @@ import axios from '@mapstore/libs/ajax'; +import { findGeometryProperty } from '@mapstore/utils/ogc/WFS/base'; export const toDownload = ({ fileName, mimeType }) => (response) => { @@ -28,7 +29,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); From c2b9e25733176f59665b3bf56ea74a4ac031c6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20J=C3=A9go?= Date: Thu, 24 Feb 2022 15:12:06 +0100 Subject: [PATCH 2/2] remove import error --- js/extension/utils/download.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/extension/utils/download.js b/js/extension/utils/download.js index 1cfa7ca..6072935 100644 --- a/js/extension/utils/download.js +++ b/js/extension/utils/download.js @@ -1,6 +1,4 @@ import axios from '@mapstore/libs/ajax'; -import { findGeometryProperty } from '@mapstore/utils/ogc/WFS/base'; - export const toDownload = ({ fileName, mimeType }) => (response) => { const dataUrl = window.URL.createObjectURL(new Blob([response.data], { type: mimeType }));