Skip to content

Commit

Permalink
Add multiple preview URL whitelist entries
Browse files Browse the repository at this point in the history
If you only have a single preview hostname and URL, it should be fully sufficient to set `studio.previewUrlPrefix` to that URL. Due to the CoreMedia issue CMS-21564, the Studio does not correctly handle the case where only `studio.previewUrlPrefix` is set, or `studio.preview-url-whitelist` has only a single entry. This results in error messages in the browser console similar to `Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://preview.127.0.0.1.nip.io') does not match the recipient window's origin ('https://studio.127.0.0.1.nip.io').`

Add the preview URL twice to `studio.preview-url-whitelist` to work around this.
  • Loading branch information
Stefan Bethke committed May 9, 2022
1 parent 63aef44 commit 71218e9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ public Map<String, String> getSpringBootProperties() {

properties.putAll(getSiteMappingProperties());
properties.put("studio.previewUrlPrefix", "https://" + getTargetState().getPreviewHostname());
// add the Studio URL twice time to work around CoreMedia bug CMS-21564. Normally, it should be sufficient
// to only have previewUrlPrefix set.
properties.put("studio.preview-url-whitelist[0]", "https://" + getTargetState().getPreviewHostname());
properties.put("studio.preview-url-whitelist[1]", "https://" + getTargetState().getPreviewHostname());
properties.put("themeImporter.apiKeyStore.basePath", "/var/tmp/themeimporter");

return properties;
Expand Down

0 comments on commit 71218e9

Please sign in to comment.