You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
multi-auth plugin will raise 500 error when use default conf.
Expected Behavior
No response
Error Logs
2024/04/16 02:33:25 [error] 3646#3646: *1579 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'
/workspaces/apisix/apisix/core/request.lua:110: in function 'header'
/workspaces/apisix/apisix/plugins/key-auth.lua:71: in function 'rewrite'
/workspaces/apisix/apisix/plugins/multi-auth.lua:71: in function 'phase_func'
/workspaces/apisix/apisix/plugin.lua:1155: in function 'run_plugin'
/workspaces/apisix/apisix/init.lua:696: in function 'http_access_phase'
access_by_lua(nginx.conf:319):2: in main chunk, client: 127.0.0.1, server: _, request: "GET /abc HTTP/1.1", host: "127.0.0.1:9080"
the multi-auth didn't check the the plugin schema, so when we use the default plugin config like {}, if we need to read the HTTP header specified by the plugin config from the request, like core.req.header(ctx, conf.header_name) , it will raise an error because conf.header_name is nil.
Current Behavior
multi-auth plugin will raise 500 error when use default conf.
Expected Behavior
No response
Error Logs
Steps to Reproduce
Environment
apisix version
):uname -a
):openresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
):luarocks --version
):The text was updated successfully, but these errors were encountered: