diff --git a/ghost/update-check-service/lib/update-check-service.js b/ghost/update-check-service/lib/update-check-service.js index 9e277a31ac..d803bfa569 100644 --- a/ghost/update-check-service/lib/update-check-service.js +++ b/ghost/update-check-service/lib/update-check-service.js @@ -38,14 +38,12 @@ class UpdateCheckService { * @param {string[]} [options.config.notificationGroups] - example values ["migration", "something"] * @param {string} options.config.siteUrl - Ghost instance URL * @param {boolean} [options.config.forceUpdate] - * @param {Function} urlFor - function creating a URL for a certain context */ - constructor({api, config, i18n, logging, urlFor, request, ghostVersion, ghostMailer}) { + constructor({api, config, i18n, logging, request, ghostVersion, ghostMailer}) { this.api = api; this.config = config; this.i18n = i18n; this.logging = logging; - this.urlFor = urlFor; this.request = request; this.ghostVersion = ghostVersion; this.ghostMailer = ghostMailer; @@ -106,7 +104,7 @@ class UpdateCheckService { const users = await this.api.users.browse(internal); const npm = await Promise.promisify(exec)('npm -v'); - const blogUrl = this.urlFor('home', true); + const blogUrl = this.config.siteUrl; const parsedBlogUrl = url.parse(blogUrl); const blogId = parsedBlogUrl.hostname + parsedBlogUrl.pathname.replace(/\//, '') + hash.value; diff --git a/ghost/update-check-service/test/update-check-service.test.js b/ghost/update-check-service/test/update-check-service.test.js index 3bdc825609..24fe48eefb 100644 --- a/ghost/update-check-service/test/update-check-service.test.js +++ b/ghost/update-check-service/test/update-check-service.test.js @@ -13,7 +13,6 @@ describe('Update Check', function () { let i18nStub; let loggingStub; let requestStub; - let urlForStub; beforeEach(function () { settingsStub = sinon.stub().resolves({ @@ -67,7 +66,6 @@ describe('Update Check', function () { }, i18n: i18nStub, logging: loggingStub, - urlFor: urlForStub, request: requestStub, ghostVersion, ghostMailer: { @@ -131,7 +129,6 @@ describe('Update Check', function () { }, i18n: i18nStub, logging: loggingStub, - urlFor: urlForStub, request: requestStub, ghostVersion, ghostMailer: { @@ -181,7 +178,6 @@ describe('Update Check', function () { }, i18n: i18nStub, logging: loggingStub, - urlFor: urlForStub, request: requestStub, ghostVersion, ghostMailer: { @@ -252,7 +248,6 @@ describe('Update Check', function () { config: {}, i18n: i18nStub, logging: loggingStub, - urlFor: urlForStub, request: sinon.stub().resolves({ body: { notifications: [notification] @@ -323,7 +318,6 @@ describe('Update Check', function () { }, i18n: i18nStub, logging: loggingStub, - urlFor: urlForStub, request: sinon.stub().resolves({ body: [notification] }),