fix
This commit is contained in:
parent
dea632654a
commit
71613c0053
|
@ -242,7 +242,8 @@ export class FileServerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream');
|
reply.header('Content-Type', FILE_TYPE_BROWSERSAFE.includes(image.type) ? image.type : 'application/octet-stream');
|
||||||
reply.header('Content-Length', getSizeFromIImage(image) ?? undefined);
|
const size = getSizeFromIImage(image);
|
||||||
|
if (size) reply.header('Content-Length', size);
|
||||||
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
||||||
reply.header('Content-Disposition',
|
reply.header('Content-Disposition',
|
||||||
contentDisposition(
|
contentDisposition(
|
||||||
|
@ -337,11 +338,10 @@ export class FileServerService {
|
||||||
.resize({
|
.resize({
|
||||||
height: 'emoji' in request.query ? 128 : 320,
|
height: 'emoji' in request.query ? 128 : 320,
|
||||||
withoutEnlargement: true,
|
withoutEnlargement: true,
|
||||||
})
|
});
|
||||||
.webp(webpDefault);
|
|
||||||
|
|
||||||
image = {
|
image = {
|
||||||
data,
|
data: await data.webp(webpDefault).toBuffer(),
|
||||||
ext: 'webp',
|
ext: 'webp',
|
||||||
type: 'image/webp',
|
type: 'image/webp',
|
||||||
};
|
};
|
||||||
|
@ -403,7 +403,8 @@ export class FileServerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
reply.header('Content-Type', image.type);
|
reply.header('Content-Type', image.type);
|
||||||
reply.header('Content-Length', getSizeFromIImage(image) ?? undefined);
|
const size = getSizeFromIImage(image);
|
||||||
|
if (size) reply.header('Content-Length', size);
|
||||||
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
reply.header('Cache-Control', 'max-age=31536000, immutable');
|
||||||
reply.header('Content-Disposition',
|
reply.header('Content-Disposition',
|
||||||
contentDisposition(
|
contentDisposition(
|
||||||
|
|
Loading…
Reference in New Issue