gxthrj edited a comment on issue #4358:
URL: https://github.com/apache/apisix/issues/4358#issuecomment-853925334


   I have tried use the cors with apisix admin-api, but got error:
   ```shell
   curl http://127.0.0.1:9080/apisix/admin/routes/2 -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1' -X PUT -i -d '
   {
       "uri": "/*",
       "hosts": ["foo.com"],
       "upstream": {
           "type": "roundrobin",
           "nodes": {
               "httpbin.org": 1
           }
       },
       "plugins": {
           "cors": {
            "allow_credential": true,
            "allow_headers": "*",
            "allow_methods": "*",
            "allow_origins": "*",
            "expose_headers": "*",
            "max_age": 5
           }
       }
   }'
   ```
   
   Got error as below
   
   ```shell
   {"error_msg":"failed to check the configuration of plugin cors err: you can 
not set '*' for other option when 'allow_credential' is true"}
   ```
   
   It seems that when the cors plug-in is created through the dashboard, there 
is no shcema verification about this.
   And APISIX will get error , when watch the change about cors plugin from 
etcd.
   
   It is a bug in dashboard.
   
   cc @nic-chen @starsz 


-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to