Skip to content

Commit

Permalink
fix: use randomFileName as default start file name to ensure the rand…
Browse files Browse the repository at this point in the history
…omness
  • Loading branch information
Yukaii committed Jun 5, 2024
1 parent d157fde commit 12ed4f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/imageRouter/filesystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function randomFilename () {
*/
function pickFilename (defaultFilename) {
let retryCounter = 5
let filename = defaultFilename
let filename = randomFilename()
const extname = path.extname(defaultFilename)
while (retryCounter-- > 0) {
if (fs.existsSync(path.join(config.uploadsPath, filename))) {
Expand Down

0 comments on commit 12ed4f5

Please sign in to comment.