Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Getting Cors error when calling an api from Live Server while localhost its working. Please help #536

Open
sunnyexchange4media opened this issue Jun 8, 2021 · 3 comments

Comments

@sunnyexchange4media
Copy link

Before you start

[ ] Update to the latest version by running composer update fruitcake/laravel-cors
[ ] Make sure that Apache/nginx/Valet are NOT also adding CORS headers

Check your config

[ ] Double-check your config file with the version from the repo. Make sure the paths property is correctly set. Start by allowing as much as possible.
[ ] Make sure the middleware is added to the global middleware in your Http Kernel (not group)

Clear your caches

Please do these steps again before submitting an issue:
[ ] Clear your config cache php artisan config:clear, route cache (php artisan route:clear) and normal cache (php artisan cache:clear).
[ ] Make sure your permissions are setup correctly (eg. storage is writable)

Make the request

Open Chrome Devtools to see which requests are actually happening. Make sure you see the actual OPTIONS requests for POST/PUT/DELETE (see https://stackoverflow.com/questions/57410051/chrome-not-showing-options-requests-in-network-tab)

Please show the actual request + response headers as sent by the OPTIONS request and the POST request (when available)

@itsamitpaul
Copy link

I am facing similar issue. I have done all the things mentioned here but the issue is not fixed yet.

@sunnyexchange4media
Copy link
Author

I am facing similar issue. I have done all the things mentioned here but the issue is not fixed yet.

you need to allow from you server-side whatever you are using in my case aws/apche and I got resolved sometime this happened please check.

@AntonLugtenburg
Copy link

Are you sure your api isn't throwing an error ? - is the api responding to postman ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants