cors.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. return [
  3. /*
  4. * A cors profile determines which origins, methods, headers are allowed for
  5. * a given requests. The `DefaultProfile` reads its configuration from this
  6. * config file.
  7. *
  8. * You can easily create your own cors profile.
  9. * More info: https://github.com/spatie/laravel-cors/#creating-your-own-cors-profile
  10. */
  11. 'cors_profile' => Spatie\Cors\CorsProfile\DefaultProfile::class,
  12. /*
  13. * This configuration is used by `DefaultProfile`.
  14. */
  15. 'default_profile' => [
  16. 'allow_credentials' => false,
  17. 'allow_origins' => [
  18. '*',
  19. ],
  20. 'allow_methods' => [
  21. 'POST',
  22. 'GET',
  23. 'OPTIONS',
  24. 'PUT',
  25. 'PATCH',
  26. 'DELETE',
  27. ],
  28. 'allow_headers' => [
  29. 'Content-Type',
  30. 'X-Auth-Token',
  31. 'Origin',
  32. 'Authorization',
  33. ],
  34. 'expose_headers' => [
  35. 'Cache-Control',
  36. 'Content-Language',
  37. 'Content-Type',
  38. 'Expires',
  39. 'Last-Modified',
  40. 'Pragma',
  41. ],
  42. 'forbidden_response' => [
  43. 'message' => 'Forbidden (cors).',
  44. 'status' => 403,
  45. ],
  46. /*
  47. * Preflight request will respond with value for the max age header.
  48. */
  49. 'max_age' => 60 * 60 * 24,
  50. ],
  51. ];