Skip to content

Commit

Permalink
Correct media type for JSON and encode reserved chars
Browse files Browse the repository at this point in the history
  • Loading branch information
tschaub committed Sep 27, 2021
1 parent 7e61229 commit 3b597fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/en/examples/vector/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const download = document.getElementById('download');
source.on('change', function () {
const features = source.getFeatures();
const json = format.writeFeatures(features);
download.href = 'data:text/json;charset=utf-8,' + json;
download.href =
'data:application/json;charset=utf-8,' + encodeURIComponent(json);
});
//! [download]

0 comments on commit 3b597fd

Please sign in to comment.