mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
Fix /apple-touch-icon not sending uploaded file
This fixes the following error: $ wget https://nodebb.yourdomain/apple-touch-icon 28/6 09:57:06 [28332] - error: /apple-touch-icon Error: ENOENT: no such file or directory, stat '/home/sweet/nodebb/public/assets/uploads/system/touchicon-orig.png' at Error (native)
This commit is contained in:
@@ -83,7 +83,13 @@ middleware.routeTouchIcon = function (req, res) {
|
||||
if (meta.config['brand:touchIcon'] && validator.isURL(meta.config['brand:touchIcon'])) {
|
||||
return res.redirect(meta.config['brand:touchIcon']);
|
||||
}
|
||||
return res.sendFile(path.join(__dirname, '../../public', meta.config['brand:touchIcon'] || '/logo.png'), {
|
||||
var iconPath = '../../public';
|
||||
if (meta.config['brand:touchIcon']) {
|
||||
iconPath += meta.config['brand:touchIcon'].replace(/assets\/uploads/, 'uploads');
|
||||
} else {
|
||||
iconPath += '/logo.png';
|
||||
}
|
||||
return res.sendFile(path.join(__dirname, iconPath), {
|
||||
maxAge: req.app.enabled('cache') ? 5184000000 : 0,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user