{{HTTPSidebar}}
The HTTP {{HTTPHeader("Content-Security-Policy")}} report-uri
directive instructs the user agent to report attempts to violate the Content Security Policy. These violation reports consist of JSON documents sent via an HTTP POST request to the specified URI.
The directive has no effect in and of itself, but only gains meaning in combination with other directives.
CSP version | 1 |
---|---|
Directive type | {{Glossary("Reporting directive")}} |
This directive is not supported in the {{HTMLElement("meta")}} element. |
Syntax
Content-Security-Policy: report-uri <uri>;
- <uri>
- A URI where to POST the report to.
Examples
See {{HTTPHeader("Content-Security-Policy-Report-Only")}} for more information and examples.
Content-Security-Policy: default-src https:; report-uri /csp-violation-report-endpoint/
Specifications
Specification | Status | Comment |
---|---|---|
{{specName("CSP 3.0", "#directive-report-uri", "report-uri")}} | {{Spec2('CSP 3.0')}} | No changes. |
{{specName("CSP 1.1", "#directive-report-uri", "report-uri")}} | {{Spec2('CSP 1.1')}} | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
{{Compat("http/headers/content-security-policy", "report-uri")}}
See also
- {{HTTPHeader("Content-Security-Policy")}}
- {{HTTPHeader("Content-Security-Policy-Report-Only")}}