I'm using the following configuration (using Node.js and Express)
app.use(helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", 'https://*.stripe.com', 'https://checkout.stripe.com'],
styleSrc: ["'self'", 'https://*.googleapis.com'],
imgSrc: ["'self'", 'data:', 'https://*.stripe.com'],
fontSrc: ["'self'", 'https://fonts.gstatic.com'],
connectSrc: ["'self'", 'https://api.stripe.com', 'https://checkout.stripe.com'],
frameAncestors: ["'none'"],
frameSrc: ["'self'", 'https://js.stripe.com', 'https://hooks.stripe.com', 'https://checkout.stripe.com'],
childSrc: ["'self'"],
baseUri: ["'self'"],
formAction: ["'self'"]
}
}));
But I still get the CSP error.
Content Security Policy: The page’s settings blocked the loading of a resource at https://js.stripe.com/v3/ (“script-src”).
I have been tinkering with it for a few day with no luck. So any help would be massive. Thank you