Embedding error

I just noticed that our sites are running into this issue as well, but only with new posts, not existing posts that already had a companion topic created for them. The Invalid X-Frame-Options header appears to be a firefox warning more than an actual error as it always shows up, even if the embedding succeeds.

A working example (with an existing topic when embedding used to work)

Whereas this landing page:

eventually receives a 400 bad request response from our Discourse instance..

I’ve been scouring these forums and the documentation for why this might be occurring but haven’t found anything yet.. I thought it might be related to us including the discourse username in the embed payload but this also occurs for content created by users that are properly synced (e.g., Winter School on Agent-Based Modeling of Social-Ecological Systems)

Things I’ve checked:

  1. DISCOURSE_ENABLE_CORS: true is set
  2. cors hosts are correct in the discourse settings with https
  3. allowed hosts are set properly (also the embedding works for already created discourse posts)

any other things I should consider looking into? The only other thing I can think of is that we recently integrated our sites with CloudFlare so perhaps there is some cloudflare config that needs to happen to make things work properly. I’m still puzzled as to why existing topics work properly though…