Hi all, I'm trying to use the Leaflet map but I'm getting a CSP error, and the maps doen not show the titles:
Refused to load the image 'https://tile.openstreetmap.org/0/0/0.png' because it violates the following Content Security Policy directive: "img-src 'self'.
I've tried adding a few URLs to the CSP confguraiton, but so far no success.
Can someone help?
Hello @Paulo Cabral de Oliveira Junior
In order to overcome that, you need to go to Content Security Policy in Lifetime (these configs are per environment) and, to make have all Leaflet functionalities not being caught by CSP, adding the following rules should be enough:
Img-src: *.openstreetmap.org
Script-src: *.openstreetmap.org
Let me know if it works.
Cheers,GM
Hi,
Try put "https://tile.openstreetmap.org" in img-src in CSP setting in the lifetime.