OLD | NEW |
(Empty) | |
| 1 <?php |
| 2 $code = $_GET['code']; |
| 3 $request_origin_value = $_SERVER["HTTP_ORIGIN"]; |
| 4 $access_control_request_headers = $_SERVER["HTTP_ACCESS_CONTROL_REQUEST_HEAD
ERS"]; |
| 5 |
| 6 if ($_SERVER['REQUEST_METHOD'] == "OPTIONS") { |
| 7 if ($code == "400") { |
| 8 header("HTTP/1.1 400"); |
| 9 } |
| 10 else if ($code == "501"){ |
| 11 header("HTTP/1.1 501"); |
| 12 } |
| 13 header("Access-Control-Allow-Methods: GET"); |
| 14 header("Access-Control-Max-Age: 1"); |
| 15 } else { |
| 16 header("HTTP/1.1 200"); |
| 17 } |
| 18 if (!is_null($request_origin_value)) { |
| 19 header("Access-Control-Allow-Origin: $request_origin_value"); |
| 20 } |
| 21 if (!is_null($access_control_request_headers)) |
| 22 header("Access-Control-Allow-Headers: $access_control_request_headers"); |
| 23 ?> |
OLD | NEW |