mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Fixed expected mime-type (#1807)
Chrome and Firefox report CSP as application/csp-report and not application/json. This lead to HTTP 400 BAD REQUEST. No csp logs were created. With this fix, the form is csp report is processed and written to logs.
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
$log_file = '/var/log/nginx/csp_violations.log';
|
||||
|
||||
// make sure we don't have any formatting issues here
|
||||
if (stristr($_SERVER['CONTENT_TYPE'], 'json') === false) {
|
||||
if (stristr($_SERVER['CONTENT_TYPE'], 'csp-report') === false) {
|
||||
http_response_code(400);
|
||||
echo "This endpoint expects JSON data. Please send data using a json mime time (for example application/json)";
|
||||
exit(0);
|
||||
|
||||
Reference in New Issue
Block a user