From 66f6d25d4b54006ad738ed4622d364488304a93c Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 1 Jun 2021 10:46:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20blank=20branding=20previ?= =?UTF-8?q?ew=20on=20split=20front-end/admin=20domain=20setups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - the POST request made to fetch the preview was going to the non-trailing-slash version of the site URL which was resulting in a redirect to the trailing-slash version which then failed due to CORS --- ghost/admin/app/components/gh-brand-settings-form.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/components/gh-brand-settings-form.js b/ghost/admin/app/components/gh-brand-settings-form.js index f24c98a84c..607ec36fda 100644 --- a/ghost/admin/app/components/gh-brand-settings-form.js +++ b/ghost/admin/app/components/gh-brand-settings-form.js @@ -142,7 +142,9 @@ export default class GhBrandSettingsFormComponent extends Component { 'x-ghost-preview': this.previewData } }; - const frontendUrl = this.config.get('blogUrl'); + + // TODO: config.blogUrl always removes trailing slash - switch to always have trailing slash + const frontendUrl = `${this.config.get('blogUrl')}/`; const previewContents = yield this.ajax.post(frontendUrl, ajaxOptions); // inject extra CSS to disable navigation and prevent clicks