-
Notifications
You must be signed in to change notification settings - Fork 0
Directive: report uri
Ryan Parman edited this page Jun 14, 2024
·
7 revisions
The 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.
Warning
In CSP Level 3, the report-uri
directive is deprecated in favor or report-to which has a different syntax. Not all browsers support report-to
yet, so we recommend using BOTH until browser support for report-to
improves.
Required reading:
Accepts one or more fully-qualified URLs, without username, password, or fragment.
report-uri https://ryanparman.report-uri.com/r/d/csp/wizard
report-uri https://ryanparman.report-uri.com/r/d/csp/wizard wss://example.org
❌ report-uri
does not fallback to default-src
.
-
CSP-0400 — [ERROR] directive
%s
has an invalid value%s
-
CSP-0401 — [ERROR] directive
%s
: could not parse as a URL:%s
-
CSP-0402 — [ERROR] directive
%s
: URL%s
is missing a SCHEME, which is required -
CSP-0403 — [ERROR] directive
%s
: URL%s
includes a FRAGMENT, which is disallowed -
CSP-0805 — [WARN] directive
report-uri
is valid in CSP2, but will be deprecated in CSP3
ABNF (CSP3)
directive-name = "report-uri"
directive-value = uri-reference *( required-ascii-whitespace uri-reference )
- uri-reference in RFC 3986 § 4.1
Content licensed under CC BY-SA.
- 🧪 Experimental, with limited support
⚠️ Important notes on usage- 🚫 Deprecated or obsolete
- base-uri
- block-all-mixed-content 🚫
- child-src
- connect-src
- default-src
- fenced-frame-src 🧪
- font-src
- form-action
- frame-ancestors
- frame-src
- img-src
- manifest-src
- media-src
- navigate-to 🚫
- object-src
- plugin-types 🚫
- prefetch-src 🚫
- referrer 🚫
- report-to 🧪
-
report-uri
⚠️ - require-trusted-types-for 🧪
- sandbox
- script-src-attr
- script-src-elem
- script-src
- style-src-attr
- style-src-elem
- style-src
- trusted-types 🧪
- upgrade-insecure-requests
- webrtc
- worker-src