Is there anyway to allow multiple cross-domains using Access-Control-Allow-Origin in the web.config file?
Currently I am using *
to allow multiple domains at once.
<add name="Access-Control-Allow-Origin" value="*" />
But I don't want to use *
because it's open for all domains and I only want to allow some specific domains.
So,there anyway to allow multiple cross-domains using the Access-Control-Allow-Origin in web.config file?
I found some related posts:
- Access-control-allow-origin with multiple domains
- Access-Control-Allow-Origin Multiple Origin Domains?
I already tried to get the request header to validate the request origin (As suggested in post 1) but was unsuccessful. Because I am using an iframe element, when I try to get the request header, it provides the origin (domain) of the iframe. But here I want the original (parent window) origin (domain).