From 0dcb1a93fd956a56bc1ab3c0ef234a9da3ed4f5f Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Wed, 5 Jun 2024 15:12:56 +0800 Subject: [PATCH] Update lib/imageRouter/filesystem.js Co-authored-by: Max Wu --- lib/imageRouter/filesystem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/imageRouter/filesystem.js b/lib/imageRouter/filesystem.js index 1f9f52181..76dd92dcf 100644 --- a/lib/imageRouter/filesystem.js +++ b/lib/imageRouter/filesystem.js @@ -22,8 +22,8 @@ function randomFilename () { */ function pickFilename (defaultFilename) { let retryCounter = 5 - let filename = randomFilename() const extname = path.extname(defaultFilename) + let filename = `${randomFilename()}${extname}` while (retryCounter-- > 0) { if (fs.existsSync(path.join(config.uploadsPath, filename))) { filename = `${randomFilename()}${extname}`