November 2015
Intermediate to advanced
152 pages
2h 46m
English
We need to supply the comma separated list of domains in the origins parameter of the [EnableCors] attribute as given in the following code snippet:
[EnableCors(origins: " http://localhost:53870, http://localhost:53871", headers: "*", methods: "*")]
As you can see, this CORS configuration only allows AJAX requests from two domains, http://localhost:53870/ and http://localhost:53871/, and rejects any requests from other domains. We can also make CORS accept any requests from all domains by passing a "*" wildcard value as follows:
[EnableCors(origins: "*", headers: "*", methods: "*")]
It is advisable to reconsider before applying the "*" wildcard value to origins, as it will allow any domain to make AJAX requests to your ...
Read now
Unlock full access