# Code highlighting failed because bunny.net CDN

**URL:** https://meta.discourse.org/t/code-highlighting-failed-because-bunny-net-cdn/296333
**Category:** Support
**Tags:** cdn, cors
**Created:** [February 22, 2024, 3:00pm UTC](https://meta.discourse.org/t/code-highlighting-failed-because-bunny-net-cdn/296333 "2024-02-22T15:00:50Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 22, 2024, 3:00pm UTC](https://meta.discourse.org/t/code-highlighting-failed-because-bunny-net-cdn/296333/1 "2024-02-22T15:00:50Z")

</div>

Someone compained that code highlighting isn’t working on their site. I’ve replicated the issue on mine. The issue seems to be that the CDN is blocked by CORS policy:

> [@](#):
>
> Access to script at ‘[https://cdn.dashboard.literatecomputing.com/highlight-js/dashboard.literatecomputing.com/8ca560096c2b0ff3f6aa461e5bf6df6ea43921a5.js](https://cdn.dashboard.literatecomputing.com/highlight-js/dashboard.literatecomputing.com/8ca560096c2b0ff3f6aa461e5bf6df6ea43921a5.js)’ from origin ‘[https://dashboard.literatecomputing.com](https://dashboard.literatecomputing.com)’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

![image](https://global.discourse-cdn.com/meta/original/4X/0/1/b/01be06c3d76d821322f545c1dbde47318c59771c.png)

I fixed the problem by adding `js` to the “add cors header” setting on the cors page:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/a/c/dace017404ee4604a6d0f6b8445a7353be53bddb.png)

If enabled, [bunny.net](http://bunny.net) will automatically add CORS headers (Cross-Origin Resource Sharing) to all requests to files with extensions from the list.

This post is to document it in case someone else has an issue with a [bunny.net](http://bunny.net) CDN and to make sure that I understand this.

---

_[View the full topic](https://meta.discourse.org/t/code-highlighting-failed-because-bunny-net-cdn/296333)._
