Meteor mrgalaxy:条带包未加载内容安全策略

时间:2015-08-31 02:41:12

标签: javascript meteor stripe-payments content-security-policy

我尝试使用带流星的条纹来创建客户,然后向客户收费,我添加了mrgalaxy:stripe。我遵循本教程:http://themeteorchef.com/recipes/building-a-saas-with-meteor-stripe-part-1/。启动流星后,我收到以下错误:

Refused to load the script 'https://js.stripe.com/v2/' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".

Refused to load the script 'https://checkout.stripe.com/checkout.js' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'".

Uncaught ReferenceError: Stripe is not defined

manifest.json有解决方法吗?如果是这样,它应该放在哪里,它应该是什么样的,我该如何阅读?

2 个答案:

答案 0 :(得分:3)

我可以通过更改app / server / startup.js来解决这个问题:

Meteor.startup( () => Modules.server.startup() );

要:

Meteor.startup( () => {
  BrowserPolicy.content.allowOriginForAll("https://js.stripe.com/")
  BrowserPolicy.content.allowOriginForAll("https://checkout.stripe.com/")
})

提出这个解决方案的有用参考是:

答案 1 :(得分:0)

AFAIK,mrgalaxy:stripe不再受到积极支持。试试copleykj:stripe-sync