# Échec de l'intégration d'embedding lorsque le navigateur supprime le referer, mauvaise solution de repli

**URL:** <https://meta.discourse.org/t/embedding-integration-failure-when-browser-strips-referrer-bad-fallback/104866>\
**Category:** Feature\
**Created:** [Décembre 21, 2018, 9:25 UTC](https://meta.discourse.org/t/embedding-integration-failure-when-browser-strips-referrer-bad-fallback/104866 "2018-12-21T21:25:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![wolftune](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wolftune/32/103569_2.png) [@wolftune](https://meta.discourse.org/u/wolftune)\
**Post date:** [Décembre 21, 2018, 9:25 UTC](https://meta.discourse.org/t/embedding-integration-failure-when-browser-strips-referrer-bad-fallback/104866/1 "2018-12-21T21:25:18Z")

</div>

via the html/js embed code in customize \> embedding, like this:

```plaintext
Allowed hosts: blog.example.com
Class name: blog
Path whitelist: /.*

Username for topic creation: system
Maximum number of posts to embed: 0
Truncate the embedded posts: checked

```

and

`DiscourseEmbed = { discourseUrl: 'https://forum.example.com/', discourseEmbedUrl: '{{@blog.url}}{{url}}' };`

Expected result: display a link to the corresponding Discourse topic for the blog post. The link shows the number of comments in the forum topic.

We’ve seen in various cases:

> Error Embedding  
> Referer:  
> The referer did not match any of the following hosts:  
> `blog.example.com`

We tracked down the error to happen on browsers stripping/spoofing the referrer header. Apparently the Discourse-supplied embed.js uses the browser referrer string to match the allowed host.

Most browsers will send referrer by default. The only exception we found is older versions (iOS 11) of Firefox/Firefox Focus. But some privacy-oriented plugins like Privacy Badger or others may strip the referrer.

The ideal solution might make this function (at least somewhat) without the referrer, but at least a friendlier and more informative error message could be along the lines of “your browser has disabled sending of referrers”. At least people should not think something else is broken with the feature…

---

_[View the full topic](https://meta.discourse.org/t/embedding-integration-failure-when-browser-strips-referrer-bad-fallback/104866)._
