Skip to content

Commit

Permalink
🐛 fix favicon path (#8190)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kirrg001 authored and ErisDS committed Mar 21, 2017
1 parent 495eee7 commit e903be6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 5 additions & 4 deletions core/server/middleware/serve-favicon.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var fs = require('fs'),
var fs = require('fs'),
path = require('path'),
crypto = require('crypto'),
config = require('../config'),
storage = require('../storage'),
settingsCache = require('../settings/cache'),
utils = require('../utils'),
crypto = require('crypto'),
settingsCache = require('../settings/cache'),
buildContentResponse,
content;

Expand Down Expand Up @@ -59,7 +60,7 @@ function serveFavicon() {
res.end(content.body);
});
} else {
filePath = 'core/shared/favicon.ico';
filePath = path.join(config.get('paths:corePath'), 'shared', 'favicon.ico');
originalExtension = path.extname(filePath).toLowerCase();

// CASE: always redirect to .ico for default icon
Expand Down
2 changes: 0 additions & 2 deletions core/test/unit/middleware/serve-favicon_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ describe('Serve Favicon', function () {
it('default favicon.ico', function (done) {
var middleware = serveFavicon();
req.path = '/favicon.ico';

configUtils.set('paths:corePath', path.join(__dirname, '../../../test/utils/fixtures/'));
localSettingsCache.icon = '';

res = {
Expand Down

0 comments on commit e903be6

Please sign in to comment.