cors.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Cross-Origin Resource Sharing (CORS) Configuration
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here you may configure your settings for cross-origin resource sharing
  9. | or "CORS". This determines what cross-origin operations may execute
  10. | in web browsers. You are free to adjust these settings as needed.
  11. |
  12. | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
  13. |
  14. */
  15. // 允许跨域的路径
  16. 'paths' => ['game*','api*', 'sanctum/csrf-cookie'],
  17. // 允许所有请求方法
  18. 'allowed_methods' => ['*'],
  19. // 允许所有源
  20. 'allowed_origins' => [
  21. '*'
  22. ],
  23. // 不使用特定的源模式
  24. 'allowed_origins_patterns' => [],
  25. // 允许所有请求头
  26. 'allowed_headers' => ['*'],
  27. // 不暴露特定头部
  28. 'exposed_headers' => [],
  29. // 不缓存预检请求
  30. 'max_age' => 0,
  31. // 允许发送凭据(如 cookies)
  32. 'supports_credentials' => true,
  33. ];