cors.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Laravel CORS Options
  6. |--------------------------------------------------------------------------
  7. |
  8. | The allowed_methods and allowed_headers options are case-insensitive.
  9. |
  10. | You don't need to provide both allowed_origins and allowed_origins_patterns.
  11. | If one of the strings passed matches, it is considered a valid origin.
  12. |
  13. | If array('*') is provided to allowed_methods, allowed_origins or allowed_headers
  14. | all methods / origins / headers are allowed.
  15. |
  16. */
  17. /*
  18. * You can enable CORS for 1 or multiple paths.
  19. * Example: ['api/*']
  20. */
  21. 'paths' => [
  22. '.well-known/*',
  23. 'api/*',
  24. 'oauth/*'
  25. ],
  26. /*
  27. * Matches the request method. `[*]` allows all methods.
  28. */
  29. 'allowed_methods' => ['*'],
  30. /*
  31. * Matches the request origin. `[*]` allows all origins. Wildcards can be used, eg `*.mydomain.com`
  32. */
  33. 'allowed_origins' => ['*'],
  34. /*
  35. * Patterns that can be used with `preg_match` to match the origin.
  36. */
  37. 'allowed_origins_patterns' => [],
  38. /*
  39. * Sets the Access-Control-Allow-Headers response header. `[*]` allows all headers.
  40. */
  41. 'allowed_headers' => ['*'],
  42. /*
  43. * Sets the Access-Control-Expose-Headers response header with these headers.
  44. */
  45. // TODO: Add support for rate-limit related headers
  46. 'exposed_headers' => ['Link'],
  47. /*
  48. * Sets the Access-Control-Max-Age response header when > 0.
  49. */
  50. 'max_age' => 0,
  51. /*
  52. * Sets the Access-Control-Allow-Credentials header.
  53. */
  54. 'supports_credentials' => false,
  55. ];