Answer the question
In order to leave comments, you need to log in
How to allow API route to be opened only from the specified domain?
I have a route https://my-api-server/data
that my application uses https://example.com
to receive data.
On this API server, I set it Access-Control-Allow-Origin
with a value https://example.com
and now this route is "embedded" only by this domain (origin). But the problem is, if I go directly to the address https://my-api-server/data
, then all the data is open.
How to make this CORS work also on a direct transition along the route and work only if the request comes from the specified domains?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question