Frontend: reactjs.
Backend: Python, Flask.
DB: MySQL on docker.
Additional service: ngrok.
I’m running a Restful API service, for testing only I want allow people to connect to my local host and I’m using ngrok as a tunnel service.
I configured all the CORS and allowed the temporary URL that was given by ngrok.
When I connect from my local machine using chrome everything works fine, but if I connect using firefox I get CORS error. Why?
Another info: When I do a ‘POST’ request everything works but ‘GET’ requests fails.
Flask code:
CORS(app, resources={r"/*": {"origins":
["http://localhost:3000",
'https://9a1e-85-64-237-52.ngrok-free.app']}}, supports_credentials=True)
In react Im using fetch()
with credentials: 'include'
.
Another thing is when ngrok generate URL when you first enter the page you enter a ‘skip’ page first, so I thought that can be an issue also. (But both in Chrom and Firefox I skip these pages).
In Firefox the Access-Control-Allow-Origin
header from response is ‘*’ but as you can see I configured it to be an origin.
If more information needed I would happy to provide it.