Skip to content

Commit 0a87338

Browse files
committed
fix(frontend): correctly parse filenames with umlauts
1 parent d1ba488 commit 0a87338

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

frontend/app/utils/parse-filename.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ const REGEX =
1414
const parseFileName = (contentDisposition) => {
1515
const { quote, filename } = REGEX.exec(contentDisposition)?.groups ?? {};
1616
if (!filename) return "Unknown file";
17-
return quote ? filename.slice(1, -1) : filename;
17+
const _filename = filename.startsWith("utf-8''")
18+
? decodeURI(filename.replace("utf-8''", ""))
19+
: filename;
20+
return quote ? _filename.slice(1, -1) : _filename;
1821
};
1922

2023
export default parseFileName;

0 commit comments

Comments
 (0)