Catch data from CSP: report-uri - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Catch data from CSP: report-uri (/showthread.php?tid=82137) |
Catch data from CSP: report-uri - Eko - 06-16-2022 Hi guys how can I catch the data from CSP: report-uri? I already active it in the config App and set the report URL in ContentSecurityPolicy.php like this: Code: public $reportURI = '/csp-violation-report-endpoint'; Code: $routes->add('csp-violation-report-endpoint', 'Home::csp'); RE: Catch data from CSP: report-uri - iRedds - 06-16-2022 Use the IncomingRequest to get the data. RE: Catch data from CSP: report-uri - Eko - 06-16-2022 Yeah, I can give it try, but the problem is it doesn't even trigger although there's some CSP violation. Any idea what can cause it? thanks. RE: Catch data from CSP: report-uri - kenjis - 06-29-2022 It seems your code should work. My Config: Code: diff --git a/app/Config/App.php b/app/Config/App.php And controller: PHP Code: <?php RE: Catch data from CSP: report-uri - Eko - 07-02-2022 Hi, thanks for your reply. I follow all your code but it still doesn't work. I got this error in my console but still, i don't see any log https://ibb.co/zHggzmt RE: Catch data from CSP: report-uri - jillianmontague1 - 07-04-2022 Thank you for the information here! |