【发布时间】:2018-06-04 13:20:06
【问题描述】:
使用内置于电子邮件预览中的 Rails 时获得以下信息:
Refused to load the stylesheet
'http://app.lvh.me:3000/packs/...' because it violates
the following Content Security
Policy directive: "style-src 'unsafe-inline'".
最后在标题中添加以下内容:
meta http-equiv="Content-Security-Policy"
content="default-src *; style-src 'self' http://* 'unsafe-inline'; script-src 'self' http://* 'unsafe-inline' 'unsafe-eval';"
但还是有问题
有人遇到并解决了这个问题吗?
【问题讨论】:
-
你能显示你的邮件中的代码吗?
-
原来我们不得不为此使用额外的 gem,如此处所述 hackernotes.io/…
标签: ruby-on-rails actionmailer preview