voten-co / voten

The code that powers voten.co
https://voten.co
Apache License 2.0
1.26k stars 233 forks source link

CORS error #352

Closed BoKKeR closed 5 years ago

BoKKeR commented 5 years ago

I have used cloud flare to point my domain to my servers IP address. After this I got an SSL certificate using letsEncrypt. I updated the domain to https in the .env file. but now I am getting CORS errors. Is this a nginx issue?

Access to XMLHttpRequest at 'https://myurl/api/guest/feed?sort=hot&page=1&filter=subscribed&exclude_liked_submissions=0&include_nsfw_submissions=0&exclude_bookmarked_submissions=0&submissions_type=All&all_tags=0' from origin 'https://myurl' has been blocked by CORS policy: Request header field X-Socket-Id is not allowed by Access-Control-Allow-Headers in preflight response.

https://i.imgur.com/m8JJs4d.png Thanks for any help

BoKKeR commented 5 years ago

Fixed by including:

composer require barryvdh/laravel-cors