Lax CORS-Logic for radio-API, so WebApps are also allowed to set frequency

This commit is contained in:
int2001
2025-10-06 10:56:23 +00:00
parent 2abf842a0e
commit 6765f0168a

View File

@@ -592,6 +592,17 @@ class API extends CI_Controller {
function radio() {
session_write_close();
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { // Preflight CORS-Check: Allow posting from web-application as well (key is still needed!)
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Max-Age: 86400');
http_response_code(200);
exit(0);
}
header('Access-Control-Allow-Origin: *'); // Allow posting from web-application as well (key is still needed!)
header('Content-type: application/json');
$this->load->model('api_model');