You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/02/24 09:12:37 UTC

[GitHub] [apisix] Gary-Airwallex opened a new issue #6439: request help: allow_origins and allow_origins_by_regex in cors plugin

Gary-Airwallex opened a new issue #6439:
URL: https://github.com/apache/apisix/issues/6439


   ### Issue description
   
   The `allow_origins_by_regex` option is used when no origin in `allow_origins` matches with request origin. What if I'd like to use allow_origins_by_regex only? Do I have to specify the string `null` for `allow_origins`? Would it be possible to make allow_origins optional (removing `default = "*"`)?
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): master
   - OS (cmd: `uname -a`): 
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6439: request help: allow_origins and allow_origins_by_regex in cors plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6439:
URL: https://github.com/apache/apisix/issues/6439#issuecomment-1050448956


   if you just want to use `allow_origins_by_regex`, no `allow_origins `, you can follow this case:
   https://github.com/apache/apisix/blob/d5d1c8a49074c0238001286f0059a6a5b5a014ed/t/plugin/cors.t#L763-L844


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] Gary-Airwallex commented on issue #6439: request help: allow_origins and allow_origins_by_regex in cors plugin

Posted by GitBox <gi...@apache.org>.
Gary-Airwallex commented on issue #6439:
URL: https://github.com/apache/apisix/issues/6439#issuecomment-1050463363


   Hi @tzssangglass in that example, the request origin is first matched with "http://sub.domain.com,http://sub2.domain.com"? It'll fail of course and then being matched against allow_origins_by_regex, but is it possible to omit the first step?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #6439: request help: allow_origins and allow_origins_by_regex in cors plugin

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #6439:
URL: https://github.com/apache/apisix/issues/6439#issuecomment-1050573968


   > Hi @tzssangglass in that example, the request origin is first matched with "http://sub.domain.com,http://sub2.domain.com"? It'll fail of course and then being matched against allow_origins_by_regex, but is it possible to omit the first step?
   
   You can try it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org