【发布时间】:2017-11-04 02:59:46
【问题描述】:
使用 Breeze JS 和严格的内容安全策略,我收到错误 Refused to evaluate a string as JavaScript because 'unsafe-eval' is not a allowed source of script in the following Content Security Policy directive。
有没有办法像 AngularJS 处理 https://docs.angularjs.org/api/ng/directive/ngCsp 一样在不使用“unsafe-eval”的情况下进行回退?
【问题讨论】:
-
你能告诉我,错误是从 Breeze 中的哪个位置引发的吗?
-
函数 t(e) { var t = e.name.replace(/\W/g, "_"); return Function("return function" + t + "(){}")() } 返回行是它出错的地方。这就是格式化的缩小代码。
标签: breeze content-security-policy