Re: [DISCUSS] How to handle allow_origins configuration conflicts in cors plugin

2022-09-20 Thread Zexuan Luo
I am curious about why a break change is needed. The problem is, "use only allow_origins_by_regex without setting the allow_origins configuration doesn't work". "Ignoring the text mode when the regular mode is used and the text mode is `*` " can solve this problem and bring the least break change.

Re: [DISCUSS] How to handle allow_origins configuration conflicts in cors plugin

2022-09-20 Thread Zeping Bai
> IMHO, I suggest ignoring the text mode when the regular mode is used and the text mode is `*`. This change won't break the existing configuration. Yes, I think we can do that, and I will impose soft restrictions for text patterns and regular patterns instead of hard restrictions using jsonschem

Re: [DISCUSS] How to handle allow_origins configuration conflicts in cors plugin

2022-09-20 Thread Zexuan Luo
IMHO, I suggest ignoring the text mode when the regular mode is used and the text mode is `*`. This change won't break the existing configuration. > Therefore, I think text mode and regular mode should be mutually exclusive, > and text mode should not have a default value of "*". This change wil

[DISCUSS] How to handle allow_origins configuration conflicts in cors plugin

2022-09-20 Thread Zeping Bai
*Background:* Currently, APISIX has a cors plugin to address browser cross-domain issues, which will handle browser requests and dynamically add allow headers. It contains an allow_origins option for handling client sources, which allows both allow_origins (hereafter referred to as text mode) and a