Array - set origin -Not working
Trying to use Array - set origin to an array of valid origins from subdomains , but it is not working
Example:
- http://test.example.com used CORS npm /.example2.com$/ NOT WORKING
Trying to use Array - set origin to an array of valid origins from subdomains , but it is not working
Example:
- http://test.example.com used CORS npm /.example2.com$/ NOT WORKING
Your regex targets example2.com. This will not work when your domain is example.com. You need to change the domain you are performing the request from to match the regex.
Trying to use Array - set origin to an array of valid origins from subdomains , but it is not working Example:
- http://test.example.com used CORS npm /.example2.com$/ NOT WORKING
Your regex targets example2.com. This will not work when your domain is
example.com. You need to change the domain you are performing the request from to match the regex.
Yes, try to Implement the same way that you are saying by trying to add example.com in the regex /.example.com$/
But still not working
Expected: CORS should allow all subdomains (sub1.example.com , sub2.example.com) under the main domain example.com
If you have done pls share me piece of code for my understanding
When using an Array or Regex, the header will appear only when there is an allowed match with the request's Origin header:
https://github.com/expressjs/cors/blob/master/lib/index.js#L58