Update cover endpoints to only allow webp, jpeg and png as optional format param

This commit is contained in:
advplyr committed 2026-09-14 17:05:07 -05:00
1 parent 5cb75a85ec
commit 42bf9512b0
1 file changed
+2
+2
View File
@@ -40,6 +40,7 @@ class CacheManager {
const width = options.width || 400
const height = options.height || null
if (!['webp', 'jpeg', 'png'].includes(format)) return res.sendStatus(400)
res.type(`image/${format}`)
const cachePath = Path.join(this.CoverCachePath, `${libraryItemId}_${width}${height ? `x${height}` : ''}`) + '.' + format
@@ -149,6 +150,7 @@ class CacheManager {
const width = options.width || 400
const height = options.height || null
if (!['webp', 'jpeg', 'png'].includes(format)) return res.sendStatus(400)
res.type(`image/${format}`)
var cachePath = Path.join(this.ImageCachePath, `${authorId}_${width}${height ? `x${height}` : ''}`) + '.' + format