Ember errors when adding script to </body>

AI-generated summary

A 403 error occurs when adding a <script> tag to the theme editor in a fresh Discourse install hosted on Discourse.org. JohnONolan initially suspected an issue with Ember JQuery, but after further investigation found that Cloudflare was intercepting the request payload and requiring a CAPTCHA to be completed. JohnONolan was able to bypass this by connecting to a VPN. jomaxro was unable to reproduce the issue on try.discourse.org. codinghorror recommends disabling Cloudflare on Discourse, except for DNS usage, as it causes many problems and a global CDN is already provided.

Have searched (a lot) to try and make sure I’m not missing something, but I’m totally stumped. Currently adding any sort of <script> tag to any part of the theme editor is throwing a 403 error on Ember JQuery.

Anyone know what’s going on here? (Using a fresh Discourse install hosted on Discourse.org)

Followed instructions here - https://meta.discourse.org/t/add-javascript-from-optimizely/35470

Error below, which I can consistently reproduce. Saving anything other than a script works fine.

Hmm…no repro on try.discourse.org.

So I poked the response body of the 403 and found it was a Cloudflare intercepting the request payload and asking me to complete a captcha :woman_shrugging:. I’m in South Africa at the moment so I managed to get around it by connecting to a VPN to the UK.

2 hours well spent :joy:

We strongly recommend you disable cloudflare on Discourse (other than for DNS usage, which is fine), it causes many problems in our experience. Plus we already provide a global CDN to all customers.