mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-12 06:21:30 +00:00
Update author & library item image endpoints to clamp width/height query params
This commit is contained in:
parent
88667d00a1
commit
455e605162
3 changed files with 16 additions and 6 deletions
|
|
@ -10,7 +10,7 @@ const CacheManager = require('../managers/CacheManager')
|
|||
const CoverManager = require('../managers/CoverManager')
|
||||
const AuthorFinder = require('../finders/AuthorFinder')
|
||||
|
||||
const { reqSupportsWebp, isValidASIN } = require('../utils/index')
|
||||
const { reqSupportsWebp, isValidASIN, clampPositiveInt } = require('../utils/index')
|
||||
|
||||
const naturalSort = createNewSortInstance({
|
||||
comparer: new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' }).compare
|
||||
|
|
@ -412,8 +412,8 @@ class AuthorController {
|
|||
|
||||
const options = {
|
||||
format: format || (reqSupportsWebp(req) ? 'webp' : 'jpeg'),
|
||||
height: height ? parseInt(height) : null,
|
||||
width: width ? parseInt(width) : null
|
||||
height: clampPositiveInt(height ? parseInt(height) : null, 4096),
|
||||
width: clampPositiveInt(width ? parseInt(width) : null, 4096)
|
||||
}
|
||||
return CacheManager.handleAuthorCache(res, authorId, options)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue