shaobo322 opened a new issue #910: bug: plugin key-auth not work as expected
URL: https://github.com/apache/incubator-apisix/issues/910
 
 
   ### Issue description
   
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 0.8
   * OS:darwin/amd64
   
   ### Minimal test code / Steps to reproduce the issue
   1. add a router to upstream service(works as expected)
   2. add key-auth plugin for above router
   3. do not add apikey header field 
   4. response message is **{"message":"Missing API key found in request"}** as 
expected
   5. add apikey in header
   6. request again exception occurs
   
   ### What's the actual result? (including assertion message & call stack if 
applicable)
   response message **500 internal server error**
   call stack like this
   ```
   coroutine 0:
           /Users/beixi/workspace/code/apisix/lua/apisix/consumer.lua: in 
function 'create_obj_fun'
           ...beixi/workspace/code/apisix/lua/apisix/core/lrucache.lua:50: in 
function 'global'
           /Users/beixi/workspace/code/apisix/lua/apisix/consumer.lua:47: in 
function 'plugin'
           ...xi/workspace/code/apisix/lua/apisix/plugins/key-auth.lua:53: in 
function 'phase_fun'
           /Users/beixi/workspace/code/apisix/lua/apisix.lua:115: in function 
'run_plugin'
           /Users/beixi/workspace/code/apisix/lua/apisix.lua:312: in function 
'http_access_phase'
           access_by_lua(nginx.conf:143):2: in main chunk, client: 127.0.0.1, 
server: , request: "POST /smartcloud/v1.1.5/devicemanager/deviceinfo/list 
HTTP/1.1", host: "127.0.0.1:9081"
   
   ```
   
   
   ### What's the expected result?
   

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


With regards,
Apache Git Services

Reply via email to