Fix image

This commit is contained in:
gprunet
2026-01-23 17:04:22 +01:00
parent d1b28549ee
commit 471be08fd7
5 changed files with 16 additions and 6 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

+1
View File
@@ -33,6 +33,7 @@ router.delete('/', authenticateToken, async(req, res) =>
router.get('/me', authenticateToken, async(req, res) =>
{
console.log('GET /me hit, user:', req.user);
const result = await avatarService.getAvatarUrl(req.user.userId);
res.status(result.status).json(result.data);
});
+2 -1
View File
@@ -128,7 +128,8 @@ async function getAvatarUrl(userId)
if (result.rows.length === 0)
return ({status: 404, data: {error: 'User not found'}});
return ({status: 200, data: {avatar_url: result.rows[0].avatar_url}});
const avatarUrl = result.rows[0].avatar_url || DEFAULT_AVATAR;
return ({status: 200, data: {avatar_url: avatarUrl}});
}
catch (err)
{
+8
View File
@@ -27,4 +27,12 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /avatar/ {
proxy_pass http://backend:3001/avatar/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_hide_header Content-Type;
add_header Cache-Control "public, max-age=3600";
}
}