]>
git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/tools/landing/report_csp_violation.php
2 $email_address = 'ismael@bouya.org';
3 $email_subject = 'Content-Security-Policy violation';
5 $current_domain = $_SERVER['SERVER_NAME'];
6 $email_subject = $email_subject . ' on ' . $current_domain;
8 http_response_code(204);
10 $json_data = file_get_contents('php://input');
12 if ($json_data = json_decode($json_data)) {
13 $json_data = json_encode($json_data, JSON_PRETTY_PRINT
| JSON_UNESCAPED_SLASHES
);
15 $message = "The following Content-Security-Policy violation occurred on " .
16 $current_domain . ":\n\n" .
18 mail($email_address, $email_subject, $message, 'Content-Type: text/plain;charset=utf-8');