disable cors policy symfony

Solutions on MaxInterview for disable cors policy symfony by the best coders in the world

showing results for - "disable cors policy symfony"
Robbie
08 Nov 2020
1//his code in the file public/index.php work perfectly.
2
3header('Access-Control-Allow-Origin: *');
4header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method");
5header("Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE");
6header("Allow: GET, POST, OPTIONS, PUT, DELETE");
7$method = $_SERVER['REQUEST_METHOD'];
8if ($method == "OPTIONS") {
9    die();
10}
11
12https://stackoverflow.com/a/60642286/7610978