Content Security Policy, otherwise known as CSP, is an additional layer of security that can help you with detecting and mitigating various attacks, like Cross-Site Scripting or Data Injection Attacks.
Learn more about CSP and check out the article prepared by the MDN web docs. For now, letâs jump below to learn how to adjust your CSP directives so that they will fully support ChatBot.
CSPÂ - learn how to adjust your CSP directives
Modifying your Content Security Policy directives
-
Modifying your CSP directives is relatively easy. All that you have to do is to edit theÂ
script-src
 directive so that itâll include the following entities:Â'self'
andÂ'unsafe-inline'
:script-src âselfâ âunsafe-inlineâ
-
Now, all that is left is to whitelist the
*.chatbot.com
 domain by adding it as a list of whitelisted sources that can load content on your website. Whitelisting our domain should look like in the following example:
Content-Security-Policy:
default-src 'self';
script-src 'self' 'unsafe-inline' *.chatbot.com;
connect-src 'self' *.chatbot.com;
img-src 'self' *.chatbot.com;
frame-src 'self' *.chatbot.com;
And thatâs it! Now, youâre ready to provide your customers with the quality support that they need!