I'm struggling to add a csp meta-tag to a GatsbyJS website. Can anyone help?
I've added meta-tag to the html.js (https://www.gatsbyjs.com/docs/custom-html/) and it displays successfully in the source at the top of my compiled site, however the csp header isn't found when I run https://csp-evaluator.withgoogle.com/.
I've also tried the https://www.gatsbyjs.com/plugins/gatsby-plugin-csp/ but this was creating a whole list of errors.
Can anyone help me please?
Much appreciated,
Paul
So, the eventual solution was to stick with the csp-plugin and add all the blocked urls to the config settings, which can be quite an annoying process. However, this plugin will only generate a meta-tag in your build. In order to create a csp header, you must add the same information on the server side. In my case, this was added to the htaccess file on the Apache server. Hope this helps someone sometime!