85
Views
2
Comments
Solved
[OutSystems Maps] Leaflet Map CSP policy
outsystems-maps
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

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?

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

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

2021-01-04 08-13-48
Toto
 
MVP

Hi,


Try put "https://tile.openstreetmap.org" in img-src in CSP setting in the lifetime.

2022-11-12 11-28-30
Gonçalo Martins
Staff
Solution

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.