0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Simplified DynamicRedirectManager's constructor

refs https://linear.app/tryghost/issue/CORE-84/have-a-look-at-the-eggs-redirects-refactor-branch

- This simplification allows to make the test for dependent services a lot more readable without a need to stub urlUtils
This commit is contained in:
Naz 2021-10-13 10:04:49 +02:00
parent 57ce743d98
commit dbdf7160bf
3 changed files with 10 additions and 7 deletions

View file

@ -11,8 +11,11 @@ const urlUtils = require('../../../shared/url-utils');
const models = require('../../models');
const redirectManager = new DynamicRedirectManager({
permanentMaxAge: config.get('caching:customRedirects:maxAge')
}, urlUtils);
permanentMaxAge: config.get('caching:customRedirects:maxAge'),
getSubdirectoryURL: (pathname) => {
return urlUtils.urlJoin(urlUtils.getSubdir(), pathname);
}
});
module.exports = {
async init() {

View file

@ -67,7 +67,7 @@
"@tryghost/email-analytics-provider-mailgun": "1.0.3",
"@tryghost/email-analytics-service": "1.0.2",
"@tryghost/errors": "0.2.16",
"@tryghost/express-dynamic-redirects": "0.1.0",
"@tryghost/express-dynamic-redirects": "0.2.0",
"@tryghost/helpers": "1.1.52",
"@tryghost/image-transform": "1.0.16",
"@tryghost/job-manager": "0.8.10",

View file

@ -1325,10 +1325,10 @@
"@tryghost/ignition-errors" "^0.1.0"
lodash "^4.17.21"
"@tryghost/express-dynamic-redirects@0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@tryghost/express-dynamic-redirects/-/express-dynamic-redirects-0.1.0.tgz#85c6caa2887034ea8064a40ca0622a87e4000c4e"
integrity sha512-C9594LRjH3wsAWUoMCb5sZg/1Ifrn/O2aQeWQeBDgqUWAScmtUuIpkPNTRrq0cZ1Yv4ig5gWMKv4YSe5TdAVdA==
"@tryghost/express-dynamic-redirects@0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@tryghost/express-dynamic-redirects/-/express-dynamic-redirects-0.2.0.tgz#a5bafcc068c14c353ba072b450be0193d504e506"
integrity sha512-ABlt58j1Lhl3tZdNlOD9wXORHeURWG0Hq5vBIrL9Fp+hyzBS3k8HeMQl4maSwudpY8WqBUjp2IUJfRO0onMVbw==
"@tryghost/helpers@1.1.52":
version "1.1.52"