简体   繁体   English

CSP是否要求“严格使用”

[英]Does CSP require “use strict”

Do I have to use the "use script" directive when serving my code with Content Security Policy enabled? 在启用内容安全策略的情况下提供代码时,是否必须使用"use script"指令? I cannot find any reference that says it is enforced but many code examples have it. 我找不到任何引用说它是强制执行的,但是许多代码示例都包含它。 I don't know if it's just best practice or required ? 我不知道这是最佳实践还是必需的

Do I have to use the "use script" directive when serving my code with Content Security Policy enabled? 在启用内容安全策略的情况下提供代码时,是否必须使用“使用脚本”指令?

No 没有

I cannot find any reference that says it is enforced 我找不到任何引用说它被强制执行

Exactly 究竟

but many code examples have it. 但是很多代码示例都有它。 I don't know if it's just best practice or required? 我不知道这是最佳实践还是必需的?

"use strict" is good practise entirely independent of the use (or otherwise) of CSP. "use strict"是完全独立于CSP使用(或其他方式)的良好实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM