Image download fix for images without extension
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-02-03 15:01:09 +01:00
parent a845f53f0a
commit 215e0c9fc4
1 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,11 @@ module.exports = Self => {
const srcFile = image.url.split('/').pop();
const dotIndex = srcFile.lastIndexOf('.');
const fileName = srcFile.substring(0, dotIndex);
let fileName = srcFile.substring(0, dotIndex);
if (dotIndex == -1)
fileName = srcFile;
const file = `${fileName}.png`;
const filePath = path.join(tempPath, file);