Replace http with https
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-04-02 14:34:16 +02:00
parent 4b9b29fc94
commit 9bbf43c590
1 changed files with 2 additions and 1 deletions

View File

@ -50,8 +50,9 @@ module.exports = Self => {
const fileName = srcFile.replace(/\.|\/|:|\?|\\|=|%/g, ''); const fileName = srcFile.replace(/\.|\/|:|\?|\\|=|%/g, '');
const file = `${fileName}.png`; const file = `${fileName}.png`;
const filePath = path.join(tempPath, file); const filePath = path.join(tempPath, file);
const imageUrl = image.url.replace('http://', 'https://');
https.get(image.url, async response => { https.get(imageUrl, async response => {
if (response.statusCode != 200) { if (response.statusCode != 200) {
const error = new Error(`Could not download the image. Status code ${response.statusCode}`); const error = new Error(`Could not download the image. Status code ${response.statusCode}`);