mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
🐛 correct favicon redirects with subdirectory (#8274)
refs #7688, #8221 Use our url util `urlFor` to ensure, the redirect includes the subdirectory, if set up.
This commit is contained in:
parent
817b8d09ca
commit
581ff67499
@ -45,7 +45,7 @@ function serveFavicon() {
|
||||
if (settingsCache.get('icon')) {
|
||||
// depends on the uploaded icon extension
|
||||
if (originalExtension !== requestedExtension) {
|
||||
return res.redirect(302, '/favicon' + originalExtension);
|
||||
return res.redirect(302, utils.url.urlFor({relativeUrl: '/favicon' + originalExtension}));
|
||||
}
|
||||
|
||||
storage.getStorage()
|
||||
@ -66,7 +66,7 @@ function serveFavicon() {
|
||||
|
||||
// CASE: always redirect to .ico for default icon
|
||||
if (originalExtension !== requestedExtension) {
|
||||
return res.redirect(302, '/favicon.ico');
|
||||
return res.redirect(302, utils.url.urlFor({relativeUrl: '/favicon.ico'}));
|
||||
}
|
||||
|
||||
fs.readFile(filePath, function readFile(err, buf) {
|
||||
|
Loading…
Reference in New Issue
Block a user