stripe checkout css content policy error

2019-05-07 19:11发布

问题:

I'm trying to create a form of Stripe Checkout inside my Ionic App. i've created a Directive that plant the form into my content view, but when i run it, the css fails on content policy violation:

checkout.js:2Refused to load the stylesheet 'https://checkout.stripe.com/v3/checkout/button-qpwW2WfkB0oGWVWIASjIOQ.css' because it violates the following Content Security Policy directive: "style-src 'self' 'unsafe-inline'". append @ checkout.js:2Button.append @ checkout.js:2(anonymous function) @ checkout.js:2Button.load @ checkout.js:2(anonymous function) @ checkout.js:2(anonymous function) @ checkout.js:2

no matter what i define in my meta tag of content policy, it's just not working what do i do wrong?

  <meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'self' 'unsafe-inline' localhost:* https://bnc.lt https://api.branch.io amazonaws.com amazonaws.com.cn checkout.stripe.com 'unsafe-eval';">

回答1:

Your style-src allows for self and unsafe-inline it should also allow for https://checkout.stripe.com