# CORS error when trying to load custom font

**URL:** <https://meta.discourse.org/t/cors-error-when-trying-to-load-custom-font/149302>\
**Category:** Development\
**Created:** [April 25, 2020, 11:48pm UTC](https://meta.discourse.org/t/cors-error-when-trying-to-load-custom-font/149302 "2020-04-25T23:48:20Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)\
**Post date:** [April 28, 2020, 1:51am UTC](https://meta.discourse.org/t/cors-error-when-trying-to-load-custom-font/149302/7 "2020-04-28T01:51:18Z")

</div>

I just tried this, just like you described, on a site with a CDN setup and it worked. So, I think this might be limited to your site.

I think the `DISCOURSE_ENABLE_CORS` setting is the inverse of what you want. Adding domains to that setting will allow requests from those domains access to your Discourse domain, not the other way around.

What you want is to allow requests from your Discourse domain to get access to the file on your CDN. I think your CDN is blocking those requests. You can confirm that by running something like this in a terminal window, after you change the values of course.

```bash
curl -H "origin: YOUR_SITE_URL" -v "PATH_TO_THE_FONT_ON_YOUR_CDN"

```

If everything is setup correctly, you should see something like this in the response headers

```plaintext
Access-Control-Allow-Origin: *

```

---

_[View the full topic](https://meta.discourse.org/t/cors-error-when-trying-to-load-custom-font/149302)._
