Referer with domain name in the slug breaks comments embed

It seems that having example.com in the blogpost slug on blog.example.com breaks the way Discourse does the Referer header matching used for comments.

This is how the bug manifested on our instance earlier today:

We did not dig too deep into this, our quick workaround was to remove . from the slug and replace it with - and then regenerate the blog website (code diff). This made the issue go away, comment section loads fine now.
Not a big deal, but this seems like a bug in Discourse, so reporting here.

1 Like

Looks like the error message is incorrect. The real reason is you’re passing incorrect “embed_url” in the above request. You can see a missing “/” in the screenshot.

Screenshot 2021-09-30 192515

3 Likes

Thanks, indeed, the referer was a bad guess on our end.
We’ll add slug normalization in blog generator, so the URL.pathname always starts with /