Content Security Policy (CSP) compatibility beta.

This commit is contained in:
2026-06-20 00:21:19 +02:00
parent 0b76255cfa
commit 8b742d997c
68 changed files with 1632 additions and 1421 deletions

View File

@@ -0,0 +1,21 @@
<?php
use api\classes\API;
session_start();
require_once "{$_SERVER['DOCUMENT_ROOT']}/api/classes/API.php";
$API = new API();
if ($API->request_method === 'GET') {
# this is used by js scripts to get the locale of the user
$locale = getPreferredLocale();
$translations = require $_SERVER['DOCUMENT_ROOT'] . "/bin/locales/{$locale}.php";
header("Cache-Control: public, max-age=3600");
header('Content-Type: application/json; charset=utf-8');
echo json_encode($translations, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
}