Current Behavior
allow_origins: Origins to allow CORS
allow_origins_by_regex: Regex to match with origin for enabling CORS.
As a user, When I set the value of allow_origins_by_regex,the orgins to allow CORS must be in the range and other origin will be failed. But it's not ready.
In code,the default value of allow orgins is ‘*’ and all origins will be passed and allow_origins_by_regex has not effect.
Expected Behavior
In my opinion,allow_origins_by_regex should be considered first. If the allow_origins_by_regex has no value. it can judge using allow_origins.
Error Logs
No response
Steps to Reproduce
set the value of allow_origins_by_regex is '.\.domain.com' and allow_origins is ''. The use of other domain names is also verified.
Environment
- APISIX version (run
apisix version):
- Operating system (run
uname -a):
- OpenResty / Nginx version (run
openresty -V or nginx -V):
- etcd version, if relevant (run
curl http://127.0.0.1:9090/v1/server_info):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run
luarocks --version):
Current Behavior
allow_origins: Origins to allow CORS
allow_origins_by_regex: Regex to match with origin for enabling CORS.
As a user, When I set the value of allow_origins_by_regex,the orgins to allow CORS must be in the range and other origin will be failed. But it's not ready.
In code,the default value of allow orgins is ‘*’ and all origins will be passed and allow_origins_by_regex has not effect.
Expected Behavior
In my opinion,allow_origins_by_regex should be considered first. If the allow_origins_by_regex has no value. it can judge using allow_origins.
Error Logs
No response
Steps to Reproduce
set the value of allow_origins_by_regex is '.\.domain.com' and allow_origins is ''. The use of other domain names is also verified.
Environment
apisix version):uname -a):openresty -Vornginx -V):curl http://127.0.0.1:9090/v1/server_info):luarocks --version):