Skip to content

Commit

Permalink
Talk about when meta tag CSP delivery is a good option
Browse files Browse the repository at this point in the history
  • Loading branch information
wbamberg committed Oct 17, 2024
1 parent 08c8663 commit 6087906
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion files/en-us/web/http/csp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ Finally we'll describe [strategies for deploying a CSP](#testing_your_policy) an

## CSP overview

A CSP should be delivered to the browser in the {{httpheader("Content-Security-Policy")}} response header. It should be set on all responses to all requests, not just the main document. You can also specify it using the [`http-equiv`](/en-US/docs/Web/HTML/Element/meta#http-equiv) attribute of your document's {{htmlelement("meta")}} element, but this does not support all CSP features and is not recommended for production sites.
A CSP should be delivered to the browser in the {{httpheader("Content-Security-Policy")}} response header. It should be set on all responses to all requests, not just the main document.

You can also specify it using the [`http-equiv`](/en-US/docs/Web/HTML/Element/meta#http-equiv) attribute of your document's {{htmlelement("meta")}} element, and this is a useful option for some use cases, such as a client-side-rendered {{glossary("SPA", "single page app")}} which has only static resources, because you can then avoid relying on any server infrastructure. However, this option does not support all CSP features.

The policy is specified as a series of _directives_, separated by semi-colons. Each directive controls a different aspect of the security policy. Each directive has a name, followed by a space, followed by a value. Different directives can have different syntaxes.

Expand Down

0 comments on commit 6087906

Please sign in to comment.