From be7ac742350edee2ac8e07692731969f83a924bf Mon Sep 17 00:00:00 2001 From: zadam Date: Fri, 5 Jun 2020 10:40:35 +0200 Subject: [PATCH] better fallback for resolving filenames of binary attachments --- src/services/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/services/utils.js b/src/services/utils.js index 7cb02ae40..539e82999 100644 --- a/src/services/utils.js +++ b/src/services/utils.js @@ -205,6 +205,14 @@ function formatDownloadTitle(filename, type, mime) { } } + if (mime === 'application/octet-stream') { + // we didn't find any good guess for this one, it will be better to just return + // the current name without fake extension. It's possible that the title still preserves to correct + // extension too + + return filename; + } + return filename + '.' + extensions[0]; } }