# Embedding error

**URL:** <https://meta.discourse.org/t/embedding-error/135153>\
**Category:** Product Support\
**Created:** [December 5, 2019, 1:20pm UTC](https://meta.discourse.org/t/embedding-error/135153 "2019-12-05T13:20:54Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![a\_lee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/a_lee/32/134326_2.png) [@a\_lee](https://meta.discourse.org/u/a_lee)\
**Post date:** [September 26, 2020, 8:45am UTC](https://meta.discourse.org/t/embedding-error/135153/10 "2020-09-26T08:45:10Z")

</div>

So after the latest Discourse update all embedded pages now report an error 😅

A typical error message we see now goes something like this, which seems to indicate that the browser is doing some referer stripping and causing the Discourse embed code to fail its validation checks:

```plaintext
Referer: `https://www.comses.net/`

The referer was either not sent, or did not match any of the following hosts:

* www.comses.net/codebases/.* 

```

Example page: [Artificial Anasazi](https://www.comses.net/codebases/2222/releases/1.1.0/)

On Chrome, even with Privacy Badger / all other extensions disabled, the referer error message always seems to appear and is probably due to [A new default Referrer-Policy for Chrome - strict-origin-when-cross-origin &nbsp;|&nbsp; Blog &nbsp;|&nbsp; Chrome for Developers](https://developers.google.com/web/updates/2020/07/referrer-policy-new-chrome-default) **UPDATE** this now works for existing topics after adding an explicit Referrer-Policy to the originating site (e.g., [https://www.comses.net](https://www.comses.net)) so for haproxy something like: `http-response set-header Referrer-Policy "no-referrer-when-downgrade"`

On Firefox and Chrome, pages with existing topics work but pages that attempt to create a new topic fail like this one: [The Bronze Age Collapse model (BACO model)](https://www.comses.net/codebases/dea16fd0-f56b-420e-a4c2-d151ffa3f2a8/releases/1.1.0/).

I’ve changed our haproxy config to set response headers for [Content-Security-Policy frame-ancestors](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) and that fixed an invalid `X-Frame-Options ALLOWALL not recognized` error in Firefox but now the request times out and eventually results in a 400 Bad Request from our Discourse forum..

The error appears to be related to [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage):

```plaintext
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://forum.comses.net') does not match the recipient window's origin ('https://www.comses.net').

```

I’ll have more time to do a deeper dive towards the end of this month when I will have some more free time but wanted to brain dump while it’s still semi-fresh - hope someone else figures out a workaround in the meantime! 😁

---

_[View the full topic](https://meta.discourse.org/t/embedding-error/135153)._
