Update:Validate image URI content-type before writing image file

This commit is contained in:
advplyr 2023-10-14 10:52:56 -05:00
parent 1f8372f5e5
commit c98fac30b6
3 changed files with 36 additions and 6 deletions

View file

@ -3,7 +3,7 @@ const Logger = require('../Logger')
const Path = require('path')
const Audnexus = require('../providers/Audnexus')
const { downloadFile } = require('../utils/fileUtils')
const { downloadImageFile } = require('../utils/fileUtils')
class AuthorFinder {
constructor() {
@ -45,7 +45,7 @@ class AuthorFinder {
const filename = authorId + '.' + ext
const outputPath = Path.posix.join(authorDir, filename)
return downloadFile(url, outputPath).then(() => {
return downloadImageFile(url, outputPath).then(() => {
return {
path: outputPath
}