A
A
Alexander Degtyarev2018-02-01 14:57:57
JavaScript
Alexander Degtyarev, 2018-02-01 14:57:57

Why doesn't CORS to websites work from a browser?

Why does CORS not work from the browser and writes the error "Failed to load https://yandex.ru/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. "
And if you make a request from a local server, everything is fine?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Filippov, 2018-02-01
@alexdeg

obviously they have registered the localhost in the headers, but the site from which you are trying to make a request is not

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question