liuxiran opened a new issue #2703: URL: https://github.com/apache/apisix/issues/2703
### Issue description ### Environment * apisix version (cmd: `apisix version`): latest master branch * OS: Fedora32 ### Minimal test code / Steps to reproduce the issue 1. Create a route, enable key-auth and response-rewrite plugins ```shell $ curl http://127.0.0.1:9080/apisix/admin/routes -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X POST -d '{"uri": "/get","methods": ["GET"],"upstream": {"type": "roundrobin","nodes": {"httpbin.org:443": 1}},"plugins": {"proxy-rewrite": {"uri": "\/get","scheme": "https"},"key-auth": {},"response-rewrite": {"status_code": 200,"body": "{\"code\": 200, \"msg\": \"success\"}"}}}' ``` 2. Create a consumer, enable key-auth plugin with key:auth-one ```shell $ curl http://127.0.0.1:9080/apisix/admin/consumers/2 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '{"username": "jack","plugins": {"key-auth": {"key": "auth-one"}}}' ``` 3. Access the route `/get` with the right key ```shell $ curl http://127.0.0.1:9080/get -H 'apikey:auth-one' {"code": 200, "msg": "success"} ``` 4. Access the route `/get` without the key ```shell $ curl http://127.0.0.1:9080/get {"code": 200, "msg": "success"} ``` ### What's the expected result? When perform step4, the request did not pass the authentication, and it should not be sent to upstream service, the expected result would be `{"message":"Missing API key found in request"}` returned by apisix. ---------------------------------------------------------------- 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]
