# Referer embeding problems - x does not match x

**URL:** https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613
**Category:** Support
**Created:** [January 12, 2022, 7:51am UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613 "2022-01-12T07:51:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ufffd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufffd/32/246028_2.png) [@ufffd](https://meta.discourse.org/u/ufffd)
#### Post date: [January 12, 2022, 7:51am UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/1 "2022-01-12T07:51:43Z")

</div>

I’ve run in circles trying to figure out why this embed isn’t working:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/e/ee2cdb9e9ac6296946f250bc64d13d5a87460bf4.png)  
It seems like it’s receiving the referer just fine but not putting two and two together. I’ve scanned around for relevant topics and couldn’t find any with this particular issue. Could it be something to do with the .quest TLD?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 14, 2022, 6:47pm UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/2 "2022-01-14T18:47:34Z")

</div>

That does look correct, any ideas @eviltrout?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 14, 2022, 7:13pm UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/3 "2022-01-14T19:13:05Z")

</div>

This is quite interesting as it should indeed match.

I’m curious if your request is including the `topic_id`? I can see a code path that might show this error by mistake if the topic is missing.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 14, 2022, 7:31pm UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/4 "2022-01-14T19:31:27Z")

</div>

Are you running latest Discourse? We removed the referer check from most places when embeding nowadays.

---

<div class="post-metadata">

### Author: ![ufffd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufffd/32/246028_2.png) [@ufffd](https://meta.discourse.org/u/ufffd)
#### Post date: [January 16, 2022, 1:09am UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/5 "2022-01-16T01:09:11Z")

</div>

I’m trying to use the `discourseEmbedUrl` setup for this site. My comment component is [on github](https://github.com/hen-community/hencommunity.quest-blog/blob/main/components/comments/Discourse.js) but the gist is:

```plaintext
    window.DiscourseEmbed = {
      discourseUrl: siteMetadata.comment.discourseConfig.url,
      discourseEmbedUrl: thread,
      discourseReferrerPolicy: 'no-referrer-when-downgrade',
    }

```

where `thread = window.location.href`

I’ve played around with configs a bit and now I’m getting the full url as Referer, but still it ‘doesn’t match’. You can see this at the [bottom of the page on the blog](https://hencommunity.quest/blog/the-communication-the-community-and-you#discourse-embed-frame)

Edit: I was running 2.8.0.beta10, I just updated to 2.8.0.beta11 and it’s still the same. The only other monkey wrench I can think of is that this Discourse instance started out on another url and was migrated (forked, really). Everything else works fine though so I have no reason to think the migration went wrong.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [January 19, 2022, 4:55pm UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/6 "2022-01-19T16:55:24Z")

</div>

I would check your `topic_embed` records in the database to make sure they are correct. The migration from the URL probably did not update those.

---

<div class="post-metadata">

### Author: ![ufffd](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ufffd/32/246028_2.png) [@ufffd](https://meta.discourse.org/u/ufffd)
#### Post date: [January 19, 2022, 6:13pm UTC](https://meta.discourse.org/t/referer-embeding-problems-x-does-not-match-x/214613/7 "2022-01-19T18:13:25Z")

</div>

That sounds like a good place to check, downloading the data explorerer now…  
Another interesting data point - everything’s working fine on our other site, [vote.hencommunity.quest](https://vote.hencommunity.quest/vote/QmU7zZepzHiLMUme1xRHZyTdbyD4j2EfUodiGJeA1Rv6QQ)

Plugin installed, `SELECT * FROM topic_embeds` pulls up 8 results, all from this vote.hencommunity.quest url, nothing from the main hencommunity.quest blog I’m trying to get working.
