CORS korrigiert
This commit is contained in:
11
webhook.php
11
webhook.php
@@ -2,7 +2,16 @@
|
||||
include 'config.php';
|
||||
include 'functions.php';
|
||||
|
||||
cors();
|
||||
// CORS
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header('Access-Control-Max-Age: 86400'); // cache for 1 day
|
||||
if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') {
|
||||
http_response_code(204);
|
||||
header("Access-Control-Allow-Headers: origin, content-type, accept");
|
||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
||||
header("Access-Control-Allow-Private-Network: true");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
// Read the raw POST data
|
||||
$data = json_decode(file_get_contents('php://input'), true)
|
||||
|
Reference in New Issue
Block a user