Skip to content

Commit

Permalink
fix: set filename correctly on s3 download
Browse files Browse the repository at this point in the history
Follow redirect URL and remove query string and fragment.
  • Loading branch information
alubbock committed Sep 10, 2024
1 parent 159d581 commit 336f4df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion thunorweb/webpack/thunorweb/js/dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const activate = function(showLicense) {

fetch($this.attr("href"))
.then(resp => {
let filename = $this.attr("href").replace(/\/$/, '');
let filename = resp.url.split('#')[0].split('?')[0].split('/').pop();
filename = filename.substring(filename.lastIndexOf('/') + 1);
let disposition = resp.headers.get('content-disposition');
if (disposition && disposition.indexOf('attachment') !== -1) {
Expand Down

0 comments on commit 336f4df

Please sign in to comment.