T
T
Timokins2017-07-27 21:22:26
JavaScript
Timokins, 2017-07-27 21:22:26

Whitelist for CORS from database?

Need advice.
Domains for the CORS whitelist are added to the application. Accordingly, verification of requests is needed.
Is it correct to crawl into the database and look at the white list with each request to the server? Or is there a better practice?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
Zakharov Alexander, 2017-07-27
@timokins

Considering that CORS does not support wildcards and regexps, it is impossible to do without a check and there is no normal practice here. Measure how long it takes you to check with a query to the database, and if it suits you, then work like this. If not, then look for a suitable database option or store a white list directly in the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question