mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Cleaned up duplicate middleware
refs 621cfd9866
- this file was meant to be moved to a folder in the referenced commit,
but that never happened
- this commit fixes that
This commit is contained in:
parent
1a04e75e8b
commit
025ebb7890
@ -1,17 +0,0 @@
|
|||||||
const urlUtils = require('../../../shared/url-utils');
|
|
||||||
|
|
||||||
function redirectAdminUrls(req, res, next) {
|
|
||||||
const subdir = urlUtils.getSubdir();
|
|
||||||
const ghostPathRegex = new RegExp(`^${subdir}/ghost/(.+)`);
|
|
||||||
const ghostPathMatch = req.originalUrl.match(ghostPathRegex);
|
|
||||||
|
|
||||||
if (ghostPathMatch) {
|
|
||||||
return res.redirect(urlUtils.urlJoin(urlUtils.urlFor('admin'), '#', ghostPathMatch[1]));
|
|
||||||
}
|
|
||||||
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = [
|
|
||||||
redirectAdminUrls
|
|
||||||
];
|
|
Loading…
Reference in New Issue
Block a user