fix: set avatar image url

This commit is contained in:
JoaquinOlivero
2024-08-01 00:01:46 +00:00
parent 98b388b999
commit 894799d626
2 changed files with 2 additions and 2 deletions

View File

@@ -229,7 +229,7 @@ class ImageProxy {
(response.headers.get('cache-control') ?? '0').split('=')[1]
);
if (!maxAge) maxAge = 604800;
if (!maxAge) maxAge = 86400;
const expireAt = Date.now() + maxAge * 1000;
const etag = (response.headers.get('etag') ?? '').replace(/"/g, '');

View File

@@ -7,7 +7,7 @@ const router = Router();
const avatarImageProxy = new ImageProxy('avatar', '');
// Proxy avatar images
router.get('/*', async (req, res) => {
const imagePath = req.path.startsWith('/') ? req.path.slice(1) : req.path;
const imagePath = req.url.startsWith('/') ? req.url.slice(1) : req.url;
try {
const imageData = await avatarImageProxy.getImage(imagePath);