Open wensenz opened 3 months ago
Hello @wensenz, also happened to me, it seems related to the plugin configuration. To solve you need to pass the optional property header, on the plugin config, like this:
{
"disable": false,
"header": "apikey",
"key": "your-key"
}
Current Behavior
2024/05/24 02:14:01 [error] 49#49: *543808 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/core/request.lua:118: bad argument #1 to 'lower' (string expected, got nil) stack traceback: coroutine 0: [C]: in function 'lower'
Expected Behavior
No response
Error Logs
2024/05/24 02:14:01 [error] 49#49: *543808 lua entry thread aborted: runtime error: /usr/local/openresty/lualib/resty/core/request.lua:118: 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:118: in function '__index' /usr/local/apisix/apisix/core/request.lua:110: in function 'header' /usr/local/apisix/apisix/plugins/key-auth.lua:71: in function 'phase_fun' [string "route#514932448631456457"]:17: in function 'phase_func' /usr/local/apisix/apisix/script.lua:52: in function 'run' /usr/local/apisix/apisix/init.lua:690: in function 'http_access_phase' access_bylua(nginx.conf:317):2: in main chunk, client: 172.23.0.1, server: , request: "GET /headers HTTP/1.1"
Steps to Reproduce
use APISIX Dashboard config
consumers :
routes: got-json:
Environment
i use docker-compose:
apisix version
): 3.9.0uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):