Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: mistake with regex

Tin Sever28b222129d3f
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index 1a7f2a4dc..a00de25d4 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -51,13 +51,16 @@ type ApiKey = {
};
function buildContentDisposition(filename: string) {
- const normalized = filename.normalize("NFC").replace(/[\r\n"]/g, "").trim();
+ const normalized = filename
+ .normalize("NFC")
+ .replace(/[\r\n"]/g, "")
+ .trim();
const safeFilename = normalized || "file";
const asciiFallback =
safeFilename
.normalize("NFKD")
.replace(/[\u0300-\u036f]/g, "")
- .replace(/[\\\/]/g, "-")
+ .replace(/[\\/]/g, "-")
.replace(/[^\x20-\x7E]+/g, "_")
.replace(/\s+/g, " ")
.trim() || "file";