This commit is contained in:
Emma [it/its]@Rory&
2025-04-09 16:38:03 +02:00
committed by Rory&
parent 2a7051bdc8
commit 126a881f31
6 changed files with 18 additions and 14 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ declare global {
}
export class SpacebarServer extends Server {
public declare options: SpacebarServerOptions;
declare public options: SpacebarServerOptions;
constructor(opts?: Partial<SpacebarServerOptions>) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+7 -7
View File
@@ -157,11 +157,13 @@ export async function ImageProxy(req: Request, res: Response) {
const buffer = Buffer.from(arrayBuffer);
if (sharp && sharpSupported.has(contentType)) {
resultBuffer = Buffer.from(await sharp
.default(buffer)
// Sharp doesn't support "scaleToFit"
.resize(width)
.toBuffer());
resultBuffer = Buffer.from(
await sharp
.default(buffer)
// Sharp doesn't support "scaleToFit"
.resize(width)
.toBuffer(),
);
} else if (Jimp && jimpSupported.has(contentType)) {
resultBuffer = await Jimp.read(buffer).then((image) => {
contentType = image.getMIME();
@@ -183,5 +185,3 @@ export async function ImageProxy(req: Request, res: Response) {
res.send(resultBuffer);
}
+3 -1
View File
@@ -49,7 +49,9 @@ router.post(
let user;
try {
const userTokenData = await checkToken(token, {select : ["email"]});
const userTokenData = await checkToken(token, {
select: ["email"],
});
user = userTokenData.user;
} catch {
throw FieldErrors({