Firefox: Clear cache on avatar upload

This commit is contained in:
Cohee
2025-02-14 23:20:33 +02:00
parent 61e056004a
commit d276d23310

View File

@@ -839,6 +839,9 @@ router.post('/edit', urlencodedParser, validateAvatarUrlMiddleware, async functi
invalidateThumbnail(request.user.directories, 'avatar', request.body.avatar_url);
await writeCharacterData(newAvatarPath, char, targetFile, request, crop);
fs.unlinkSync(newAvatarPath);
// Bust cache to reload the new avatar
response.setHeader('Clear-Site-Data', '"cache"');
}
return response.sendStatus(200);