AlexStack
AlexStack

Reputation: 17431

Does CSP require "use strict"

Do I have to use the "use script" directive when serving my code with Content Security Policy enabled? 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?

Upvotes: 0

Views: 86

Answers (1)

Quentin
Quentin

Reputation: 944320

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.

Upvotes: 1

Related Questions