dickens7 commented on issue #7276:
URL: https://github.com/apache/apisix/issues/7276#issuecomment-1193235300

   
   I ran into a similar problem with this PR 
https://github.com/apache/apisix/pull/6502
   
   The following configuration can reproduce this problem
   
   > Route
   
   ```json
   {
     "uri": "/*",
     "plugins": {
       "key-auth": {
         "disable": false
       }
     },
     "upstream": {
       "nodes": [
         {
           "host": "127.0.0.1",
           "port": 9080,
           "weight": 1
         }
       ],
       "type": "roundrobin",
       "scheme": "http",
       "pass_host": "pass",
     },
     "status": 1
   }
   ```
   
   > Consumer
   ```
   {
     "username": "test",
     "plugins": {
       "ip-restriction": {
         "disable": false,
         "whitelist": [
           "127.0.0.1"
         ]
       },
       "key-auth": {
         "disable": false,
         "key": "xxxxxx"
       }
     }
   }
   ```
   
   > Error Log
   
   ```
   2022/07/24 02:42:30 [error] 48#48: *18767 lua entry thread aborted: runtime 
error: /usr/local/openresty/lualib/resty/core/request.lua:116: bad argument #1 
to 'lower' (string expected, got nil)
   stack traceback:
   coroutine 0:
           [C]: in function 'lower'
           /usr/local/openresty/lualib/resty/core/request.lua:116: in function 
'__index'
           /usr/local/apisix/apisix/core/request.lua:92: in function 'header'
           /usr/local/apisix/apisix/plugins/key-auth.lua:88: in function 
'phase_func'
           /usr/local/apisix/apisix/plugin.lua:746: in function 'run_plugin'
           /usr/local/apisix/apisix/init.lua:478: in function 
'http_access_phase'
           access_by_lua(nginx.conf:364):2: in main chunk, client: 172.22.0.3, 
server: _, request: "GET / HTTP/1.1", host: "172.22.0.5"
   ```
   


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to