fix: set avatar image url
This commit is contained in:
@@ -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, '');
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user