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 2021/06/03 14:44:53 UTC

[GitHub] [apisix] gxthrj commented on issue #4358: request help: apisix cannot use CORS plug-in after upgrading from 2.0 to 2.5 and partial route failure

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


-- 
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:
users@infra.apache.org