mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-06-26 02:59:42 +02:00
apple-touch-icon for Web App on IOS
route apple-touch-icon not serving touchicon-orig.png. I made needed correction to file path. Now works with new /assets and strategy.
This commit is contained in:
@@ -122,7 +122,9 @@ middleware.routeTouchIcon = function (req, res) {
|
||||
if (meta.config['brand:touchIcon'] && validator.isURL(meta.config['brand:touchIcon'])) {
|
||||
return res.redirect(meta.config['brand:touchIcon']);
|
||||
} else {
|
||||
return res.sendFile(path.join(__dirname, '../../public', meta.config['brand:touchIcon'] || '/logo.png'), {
|
||||
var touchIconPath = meta.config['brand:touchIcon'] || 'logo.png';
|
||||
touchIconPath = path.join(nconf.get('base_dir'), 'public', touchIconPath.replace(/assets\/uploads/, 'uploads'));
|
||||
return res.sendFile(touchIconPath, {
|
||||
maxAge: req.app.enabled('cache') ? 5184000000 : 0
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user