Skip to main content

Content security policy (CSP)

If your website that uses mosparo uses CSP to protect it, you need to adjust the CSP header and add the mosparo-specific directives. If you don't do this, mosparo will not work correctly.

Please set or adjust (if you have them already in your CSP header) the following directives:

CSP directivesExample valueDescription
script-srchttps://mosparo.example.comAllows loading of the mosparo script.
style-srchttps://mosparo.example.comAllows the styles required for the mosparo box.
connect-srchttps://mosparo.example.comAllows communication with the mosparo API.
img-srchttps://mosparo.example.comAllows images (SVG) used by mosparo.
info

Please replace mosparo.example.com with the URL of your mosparo installation.

Example

Header
Content-Security-Policy: default-src 'self'; img-src 'self' https://mosparo.example.com; script-src 'self' https://mosparo.example.com; style-src 'self' https://mosparo.example.com; connect-src 'self' https://mosparo.example.com