fruitcake / laravel-cors

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
MIT License
6.27k stars 613 forks source link

Cannot set the same Access-Control-Allow-Headers values in apache setting? #541

Open charleshenryhugo opened 3 years ago

charleshenryhugo commented 3 years ago

I set Access-Control-Allow-Headers in apache conf as: Header set Access-Control-Allow-Headers "X-Requested-With"

Then set the same value in laravel-cors config: 'allowed_headers' => ['X-Requested-With']

Then requests will be CORS blocked.

What't the reason of this?

barryvdh commented 3 years ago

Either set them in Apache, or use this module. Not both.