mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Lax CORS-Logic for radio-API, so WebApps are also allowed to set frequency
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user