Answer the question
In order to leave comments, you need to log in
Why does a request sometimes fail CORS validation?
Why only sometimes the request fails CORS validation?
When accessing https://lazuren.ru/ (SPA) through a browser, it receives data via the API and sometimes requests to the same endpoint do not pass the CORS check.
To visually see what I'm talking about, refresh the page several times and look at the development panel.
Answer the question
In order to leave comments, you need to log in
Because there are no CORS headers in the responses.
lazuren.ru and api.lazuren.ru are two different domains, and when a page opened from one domain accesses another domain, the browser requires CORS headers either in the response to the request itself or in response to the OPTIONS pre-request.
https://developer.mozilla.org/en/docs/Web/HTTP/CORS
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question