Skip to content

Commit

Permalink
🐛 correct favicon redirects with subdirectory (#8274)
Browse files Browse the repository at this point in the history
refs #7688, #8221 

Use our url util `urlFor` to ensure, the redirect includes the subdirectory, if set up.
  • Loading branch information
aileen authored and ErisDS committed Apr 5, 2017
1 parent 817b8d0 commit 581ff67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/server/middleware/serve-favicon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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) {
Expand Down

0 comments on commit 581ff67

Please sign in to comment.