A
A
Artem Prokhorov2021-06-07 00:02:35
CORS
Artem Prokhorov, 2021-06-07 00:02:35

Why is CORS throwing an error?

On Vue I make a request for the back end of yii2, I registered everything in behaviors.
localhost:8080 , this is the domain from which I am making a request for a back, the back itself is back.ru/some_path
So the link below gives the answer without problems

back.ru/menu?expand=menu_id,status,link,role&per-p...

, and this link back.ru/menu?tree=1 will

give the following error:

Access to fetch at ' back.ru/menu?tree=1 ' from origin ' localhost:8080 ' has been blocked by CORS policy: No 'Access -Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

How would I ever encounter this for the first time, that an already configured cors behaves like this, how does it not give the same domain access to different URLs?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question