From 22f56c95a8779fcb41a558405aadf8b2379c77cb Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Mon, 24 Jun 2019 10:56:30 +0200 Subject: [PATCH] Fixed redirects.json file validation refs #10790 - Reference to method previously used to validate wasn't updated during refactoring done in be27db46ebc539d24f6151a9a0117f12356ae65c --- core/frontend/services/redirects/index.js | 4 ++++ core/server/web/shared/middlewares/custom-redirects.js | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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) => { /**