fix thumbnail with no method

master
lauren n. liberda 2023-12-15 01:48:34 +01:00
parent 6fdd0c2831
commit fc6236e3ac
No known key found for this signature in database
GPG Key ID: 734C629FD04BD319
1 changed files with 4 additions and 2 deletions

View File

@ -124,12 +124,14 @@ media.get('/thumbnail/:serverName/:mediaId', async (ctx) => {
if (
typeof ctx.query.width !== 'string' ||
typeof ctx.query.height !== 'string' ||
typeof ctx.query.method !== 'string'
(typeof ctx.query.method !== 'string' && typeof ctx.query.method !== 'undefined')
) {
return;
}
const { method } = ctx.query;
assert(['crop', 'scale'].includes(method));
if (method) {
assert(['crop', 'scale'].includes(method));
}
const width = parseInt(ctx.query.width, 10);
const height = parseInt(ctx.query.height, 10);