gatsby-plugin-csp | Gatsby plugin which adds strict Content Security Policy | Security library
kandi X-RAY | gatsby-plugin-csp Summary
kandi X-RAY | gatsby-plugin-csp Summary
A Gatsby plugin which adds strict Content Security Policy to your project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Computes the hash of a component by a given type .
- Remove spaces from a given string .
- Compute hash for a component .
gatsby-plugin-csp Key Features
gatsby-plugin-csp Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-plugin-csp
QUESTION
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
...ANSWER
Answered 2020-Sep-10 at 14:33The documentation recommends against trying to use html.js
to modify the :
Anything you render in the html.js component will not be made “live” in the client like other components. If you want to dynamically update your we recommend using React Helmet.
You might have better luck instead adding something like this to gatsby-browser.js
and gatsby-ssr.js
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-plugin-csp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page