跳转到主要内容

CSP HTTP header format

import { GlossaryTooltip } from "~/components";

The format of the Content Security Policy (CSP) report-only HTTP header added by Cloudflare is the following:

content-security-policy-report-only: script-src 'unsafe-inline' 'unsafe-eval'; connect-src 'none'; report-uri https://csp-reporting.cloudflare.com/cdn-cgi/script_monitor/report?<QUERY_STRING>

If you configured the reporting endpoint to use the same hostname, the HTTP header will have the following format:

content-security-policy-report-only: script-src 'unsafe-inline' 'unsafe-eval'; connect-src 'none'; report-uri <YOUR_HOSTNAME>/cdn-cgi/script_monitor/report?<QUERY_STRING>

:::note[Notes]

Cloudflare adds the CSP report-only HTTP header used to monitor webpage resources to a sample of sent responses.

Configuring log rules will add other CSP report-only headers to responses. Cloudflare does not perform any sampling for these report-only headers related to customer-defined content security rules.

:::