You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  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 ['*'] 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. /*
  23. * Matches the request method. `['*']` allows all methods.
  24. */
  25. 'allowed_methods' => ['*'],
  26. /*
  27. * Matches the request origin. `['*']` allows all origins. Wildcards can be used, eg `*.mydomain.com`
  28. */
  29. 'allowed_origins' => ['*'],
  30. /*
  31. * Patterns that can be used with `preg_match` to match the origin.
  32. */
  33. 'allowedOriginsPatterns' => ['Content-Type', 'X-Requested-With'],
  34. /*
  35. * Sets the Access-Control-Allow-Headers response header. `['*']` allows all headers.
  36. */
  37. 'allowed_headers' => ['*'],
  38. /*
  39. * Sets the Access-Control-Expose-Headers response header with these headers.
  40. */
  41. 'exposed_headers' => [],
  42. /*
  43. * Sets the Access-Control-Max-Age response header when > 0.
  44. */
  45. 'max_age' => 0,
  46. /*
  47. * Sets the Access-Control-Allow-Credentials header.
  48. */
  49. 'supports_credentials' => false,
  50. ];