Customizing worker to exclude domains from hotlink-protection


#1

So I’ve decided that using a Worker to set up hot-link protection on my site is probably the best way to not have it block all domains, as I want still want to allow hot-linking on a handful of certain domains.

I’ve had a look at the Hot-Link Protection Worker Recipe but I can’t for the life of me figure out how I can customize it to exclude certain domains. Granted, I’m not very technical, so analyzing and re-writing code is a bit out of my field, so I was hoping someone here would be so kind as to help me out. I would really appreciate any help… :slight_smile:


#2

The following should work:

You only need to add the domains you want to whitelist on line 19.

Let me know how it works for you! :slight_smile:


#3

This topic was automatically closed after 14 days. New replies are no longer allowed.