No, multiple Access-Control-Allow-Origin headers are not valid. You can have only one Access-Control-Allow-Origin response header, and this header can have only one start value or * (for example, you cannot have multiple spatial sections).
Your best option is to read the Origin incoming header, check its value on the white list, and only generate the Access-Control-Allow-Origin header, if Genesis is allowed. Here is an example in pseudo code:
origin = request.getHeader('Origin'); for each domain in myDomains if (domain == origin) // Add header if the origin is whitelisted addheader Access-Control-Allow-Origin: domain return // Otherwise exit the for loop without adding any headers.
source share