I noticed that Cloudflare is adding it’s own “Report-To” header to all responses coming back from my proxied URL. The value of the “Report-To” header looks like this:
I am having the exact same issue and would love some assistance.
I tried implementing my CSP header with just “report-to ” as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only but not having any luck.
I think report-uri is the one thats deprecated in favour of report-to - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri.
So I was trying just "Content-Security-Policy-Report-Only: default-src 'self' etc; report-to https://myendpoint.com/endpoint.php"
As thats what the Mozilla documentation seemed to think was an option but I’ve not had any success. I suspect that since the group name approach that you’ve outlined is a separate header that Cloudflare adds - its taking precedence. It might be possible to use this “single header solution” if we can disable the separate Report-To header…
So I wanted update you that I somehow managed to workaround this issue and I have CSP reporting working against my endpoint.
What I did was instead of trying to manipulate Cloudflare’s “Report-To” header I added another header called: "Reporting-Endpoints” using Transform Rules with this value:
Thanks elad, however I’ve tried this exact set up and I am seeing exactly the headers I want but nothing is coming through to my endpoint. Is your endpoint a URL on the same domain that you are testing or a remote URL?
From the documentation it sounds so simple yet I just don’t receive any JSON.