diff --git a/core/frontend/services/redirects/index.js b/core/frontend/services/redirects/index.js index fd3eefd1f1..edb2650676 100644 --- a/core/frontend/services/redirects/index.js +++ b/core/frontend/services/redirects/index.js @@ -1,5 +1,9 @@ module.exports = { get settings() { return require('./settings'); + }, + + get validation() { + return require('./validation'); } }; diff --git a/core/server/web/shared/middlewares/custom-redirects.js b/core/server/web/shared/middlewares/custom-redirects.js index 5fa3088fd8..0476e2e4c5 100644 --- a/core/server/web/shared/middlewares/custom-redirects.js +++ b/core/server/web/shared/middlewares/custom-redirects.js @@ -5,7 +5,7 @@ const path = require('path'); const debug = require('ghost-ignition').debug('web:shared:mw:custom-redirects'); const config = require('../../../config'); const common = require('../../../lib/common'); -const validation = require('../../../data/validation'); +const redirectsService = require('../../../../frontend/services/redirects'); const _private = {}; @@ -19,7 +19,7 @@ _private.registerRoutes = () => { try { let redirects = fs.readFileSync(path.join(config.getContentPath('data'), 'redirects.json'), 'utf-8'); redirects = JSON.parse(redirects); - validation.validateRedirects(redirects); + redirectsService.validation.validate(redirects); redirects.forEach((redirect) => { /**