fruitcake / laravel-cors

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

How to add add Access-Control-Allow-Origin to error 500 response #562

Closed d4rkr3pt0r closed 2 years ago

d4rkr3pt0r commented 2 years ago

When I send a request to laravel using axios, if error 500 happens I get Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8000/api/addUsersToShift. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 500.. CORS headers are adding on 422 errors, So I only problem with 500 error.