Is there a way to allow multiple cross-domains using the Access-Control-Allow-Origin
header?
I\'m aware of the *
, but it is too open. I rea
Below answer is specific to C#, but the concept should be applicable to all the different platforms.
To allow Cross Origin Requests from a web api, You need to allow Option requests to your Application and Add below annotation at controller level.
[EnableCors(UrlString,Header, Method)] Now the origins can be passed only a s string. SO if you want to pass more than one URL in the request pass it as a comma seperated value.
UrlString = "https://a.hello.com,https://b.hello.com"