mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-13 12:23:34 +01:00
Update cover endpoints to only allow webp, jpeg and png as optional format param
This commit is contained in:
1 parent
5cb75a85ec
commit
42bf9512b0
1 file changed
+2
@@ -40,6 +40,7 @@ class CacheManager {
|
|||||||
const width = options.width || 400
|
const width = options.width || 400
|
||||||
const height = options.height || null
|
const height = options.height || null
|
||||||
|
|
||||||
|
if (!['webp', 'jpeg', 'png'].includes(format)) return res.sendStatus(400)
|
||||||
res.type(`image/${format}`)
|
res.type(`image/${format}`)
|
||||||
|
|
||||||
const cachePath = Path.join(this.CoverCachePath, `${libraryItemId}_${width}${height ? `x${height}` : ''}`) + '.' + 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 width = options.width || 400
|
||||||
const height = options.height || null
|
const height = options.height || null
|
||||||
|
|
||||||
|
if (!['webp', 'jpeg', 'png'].includes(format)) return res.sendStatus(400)
|
||||||
res.type(`image/${format}`)
|
res.type(`image/${format}`)
|
||||||
|
|
||||||
var cachePath = Path.join(this.ImageCachePath, `${authorId}_${width}${height ? `x${height}` : ''}`) + '.' + format
|
var cachePath = Path.join(this.ImageCachePath, `${authorId}_${width}${height ? `x${height}` : ''}`) + '.' + format
|
||||||
|
|||||||
Reference in new issue
Block a user