Explorar el Código

修改跨域适应跨域上传文件

visuddhinanda hace 3 años
padre
commit
3047c63c64
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      config/cors.php

+ 2 - 2
config/cors.php

@@ -17,13 +17,13 @@ return [
 
 
     'paths' => ['api/*'],
     'paths' => ['api/*'],
 
 
-    'allowed_methods' => ['GET','POST','PUT','DELETE','PATCH'],
+    'allowed_methods' => ['GET','POST','PUT','DELETE','PATCH','OPTIONS'],
 
 
     'allowed_origins' => [env('ALLOWED_ORIGINS', 'http://127.0.0.1:3000')],
     'allowed_origins' => [env('ALLOWED_ORIGINS', 'http://127.0.0.1:3000')],
 
 
     'allowed_origins_patterns' => [],
     'allowed_origins_patterns' => [],
 
 
-    'allowed_headers' => ['content-type','cookie','authorization'],
+    'allowed_headers' => ['content-type','cookie','authorization','x-requested-with'],
 
 
     'exposed_headers' => [],
     'exposed_headers' => [],