Disable Cors Policy Symfony

[Solved] Disable Cors Policy Symfony | Php Frameworks Symfony - Code Explorer | yomemimo.com
Question : disable cors policy symfony

Answered by : kartik-watts

//his code in the file public/index.php work perfectly.
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
header("Allow: GET, POST, OPTIONS, PUT, DELETE");
$method = $_SERVER['REQUEST_METHOD'];
if ($method == "OPTIONS") { die();
}
https://stackoverflow.com/a/60642286/7610978

Source : | Last Update : Tue, 20 Apr 21

Answers related to disable cors policy symfony

Code Explorer Popular Question For Php Frameworks Symfony