wugg 2 years ago
parent
commit
11a396f7d8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      public/index.php

+ 4 - 0
public/index.php

@@ -17,6 +17,10 @@ header('Access-Control-Allow-Origin:*');
 header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE');
 header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization");
 // 执行HTTP应用并响应
+if($_SERVER['REQUEST_METHOD']=="OPTIONS"){
+    echo '';
+    exit();
+}
 $http = (new App())->http;
 
 $response = $http->run();