https://discord.gg/botpress logo
Do not require 'unsafe-inline' in Content Security...
# 👀feature-requests
m
When adding botpress to a site that uses Content-Security-Policy (CSP), botpress will not work unless you add a number of headers (see https://discord.com/channels/1108396290624213082/1433049277994762343 for a request for documentation from me). Most of these are fine, but 'unsafe-inline' for style-src is not going to be allowed in our production site, making it impossible to use botpress for us (and we really like it, so that would be a shame!). There is the possibility to specify a lot of hashes, but this sounded very brittle and probably would lead to a string that exceeds the max length we can specify. It would be awesome if someone could adjust the code so that 'unsafe-inline' is not needed anymore. (maybe using a nonce?) Reproduction: You can check the issue using a local index.html (attached, add your own botpress includes). Install 'serve' (npm install serve), put the serve.json and index.html in a folder, and in that folder run ' serve -l 8000'. In a browser go to localhost:8000. If you remove the unsafe-unline from the CSP header in the json file, in the devtools you will see console logs errors. https://cdn.discordapp.com/attachments/1433052093186441287/1433052093337305181/index.html?ex=69034943&is=6901f7c3&hm=08ce608df3d09fc6deefa275ff19646cbbf464990b53bb8b62890fa4c171bf11& https://cdn.discordapp.com/attachments/1433052093186441287/1433052093639430234/serve.json?ex=69034943&is=6901f7c3&hm=9125c2dbd5229e82c1f4a86361fa691e5441f34cf3fb47ea6e0622504571519b&