Skip to content

Commit

Permalink
Merge pull request #152 from georchestra/issue-143
Browse files Browse the repository at this point in the history
remove duplicated quote to remove underscore create by browser
  • Loading branch information
pierrejego authored Mar 23, 2022
2 parents 6dc4791 + c2b9e25 commit d0ea5e9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/extension/utils/download.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d0ea5e9

Please sign in to comment.