From 437283b1d9cf059a6534e4248e0926f2dfc0df6d Mon Sep 17 00:00:00 2001 From: Ekaterina Chantsova Date: Thu, 12 Nov 2026 15:52:00 +0200 Subject: [PATCH] Fixed download file name for files with quotes in the name getFilenameFromHttpHeader stopped at the first quote inside filename="...", so a file named a"b.png was saved as a\. It now reads the full quoted string and unescapes it. --- ui-ngx/src/app/core/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index dfa3d526e9..5b134a2b56 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -1240,9 +1240,9 @@ export const getFilenameFromHttpHeader = (headers: HttpHeaders): string => { if (filenameStarMatch && filenameStarMatch[1]) { return decodeURIComponent(filenameStarMatch[1]); } - const filenameMatch = /filename="([^"]+)"/i.exec(header); + const filenameMatch = /filename="((?:[^"\\]|\\.)+)"/i.exec(header); if (filenameMatch && filenameMatch[1]) { - return filenameMatch[1]; + return filenameMatch[1].replace(/\\(.)/g, '$1'); } } return headers.get('x-filename') ?? '';