Actualiser api/auth.php
This commit is contained in:
@@ -1,4 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
// Autoriser les requêtes depuis n'importe quelle origine
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
|
||||||
|
header("Access-Control-Allow-Headers: Content-Type, Authorization, X-Requested-With");
|
||||||
|
|
||||||
|
// Répondre immédiatement aux requêtes preflight OPTIONS
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||||
|
http_response_code(200);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
require_once 'config.php';
|
require_once 'config.php';
|
||||||
|
|
||||||
$method = $_SERVER['REQUEST_METHOD'];
|
$method = $_SERVER['REQUEST_METHOD'];
|
||||||
|
|||||||
Reference in New Issue
Block a user