From 42bf9512b0f963f3c7ecb8a76d6cfc724c5cf590 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 14 Sep 2026 17:05:07 -0500 Subject: [PATCH] Update cover endpoints to only allow webp, jpeg and png as optional format param --- server/managers/CacheManager.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/managers/CacheManager.js b/server/managers/CacheManager.js index 38c0415e9..df70a4c65 100644 --- a/server/managers/CacheManager.js +++ b/server/managers/CacheManager.js @@ -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