M
M
Mishcake2022-04-10 13:18:38
CORS
Mishcake, 2022-04-10 13:18:38

How to understand CORS in simple terms?

Hello. Help me understand what CORS is) I read various articles and can't get enough of it.

I do a fetch to a third-party API from the frontend, the browser swears. I understand correctly that if the service on the other side does not allow requests to itself through the API from any domains (or from mine specifically), then I won’t get rid of the error?

And in this case, you have to make requests to the API from the server (via the backend)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2022-04-10
@Mishcake

Servers in a special header give a list of domains from which they can be accessed, and the browser checks that the script it runs is trying to make a request from an allowed domain. You understand correctly, the only way to get around is to make requests through an intermediary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question