mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
🐛 fix favicon path (#8190)
closes #8187 - if you start Ghost via the Ghost-CLI, the path to the favicon must be absolute - because the CLI spawns a Ghost process from the root folder of the CLI folder e.g. node current/index.js
This commit is contained in:
parent
495eee7747
commit
e903be6679
2 changed files with 6 additions and 7 deletions
|
@ -1,9 +1,10 @@
|
||||||
var fs = require('fs'),
|
var fs = require('fs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
storage = require('../storage'),
|
|
||||||
settingsCache = require('../settings/cache'),
|
|
||||||
utils = require('../utils'),
|
|
||||||
crypto = require('crypto'),
|
crypto = require('crypto'),
|
||||||
|
config = require('../config'),
|
||||||
|
storage = require('../storage'),
|
||||||
|
utils = require('../utils'),
|
||||||
|
settingsCache = require('../settings/cache'),
|
||||||
buildContentResponse,
|
buildContentResponse,
|
||||||
content;
|
content;
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ function serveFavicon() {
|
||||||
res.end(content.body);
|
res.end(content.body);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
filePath = 'core/shared/favicon.ico';
|
filePath = path.join(config.get('paths:corePath'), 'shared', 'favicon.ico');
|
||||||
originalExtension = path.extname(filePath).toLowerCase();
|
originalExtension = path.extname(filePath).toLowerCase();
|
||||||
|
|
||||||
// CASE: always redirect to .ico for default icon
|
// CASE: always redirect to .ico for default icon
|
||||||
|
|
|
@ -87,8 +87,6 @@ describe('Serve Favicon', function () {
|
||||||
it('default favicon.ico', function (done) {
|
it('default favicon.ico', function (done) {
|
||||||
var middleware = serveFavicon();
|
var middleware = serveFavicon();
|
||||||
req.path = '/favicon.ico';
|
req.path = '/favicon.ico';
|
||||||
|
|
||||||
configUtils.set('paths:corePath', path.join(__dirname, '../../../test/utils/fixtures/'));
|
|
||||||
localSettingsCache.icon = '';
|
localSettingsCache.icon = '';
|
||||||
|
|
||||||
res = {
|
res = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue