From 484061e04a8cc01b60e6d200e7a42e79a187ae0e Mon Sep 17 00:00:00 2001 From: Madhawa Gunasekara Date: Sun, 12 Nov 2023 19:39:55 +0100 Subject: [PATCH] fix code checks --- apisix/plugins/multi-auth.lua | 2 +- t/plugin/multi-auth.t | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apisix/plugins/multi-auth.lua b/apisix/plugins/multi-auth.lua index c7322942d62c0..82e6e594ac130 100644 --- a/apisix/plugins/multi-auth.lua +++ b/apisix/plugins/multi-auth.lua @@ -69,7 +69,7 @@ function _M.rewrite(conf, ctx) for k, auth_plugin in pairs(auth_plugins) do for key, value in pairs(auth_plugin) do local auth = require("apisix.plugins." .. key) - local auth_code, b = auth.rewrite(value, ctx) + local auth_code = auth.rewrite(value, ctx) status_code = auth_code if auth_code == nil then core.log.debug("Authentication is successful" .. key .. " plugin") diff --git a/t/plugin/multi-auth.t b/t/plugin/multi-auth.t index fc4e492aa5425..72360f5d1bc1e 100644 --- a/t/plugin/multi-auth.t +++ b/t/plugin/multi-auth.t @@ -154,7 +154,7 @@ GET /hello Authorization: Basic YmFyOmJhcgo= --- error_code: 401 --- response_body -{"message":"Authorization Failed."} +{"message":"Authorization Failed"} @@ -165,7 +165,7 @@ GET /hello apikey: auth-two --- error_code: 401 --- response_body -{"message":"Authorization Failed."} +{"message":"Authorization Failed"} @@ -200,7 +200,7 @@ apikey: auth-two GET /t --- error_code: 400 --- response_body -{"error_msg":"invalid plugins configuration: failed to check the configuration of plugin multi-auth err: property \"auth_plugins\" is required"} +{"error_msg":"failed to check the configuration of plugin multi-auth err: property \"auth_plugins\" is required"} @@ -241,4 +241,4 @@ GET /t GET /t --- error_code: 400 --- response_body -{"error_msg":"invalid plugins configuration: failed to check the configuration of plugin multi-auth err: property \"auth_plugins\" validation failed: expect array to have at least 2 items"} +{"error_msg":"failed to check the configuration of plugin multi-auth err: property \"auth_plugins\" validation failed: expect array to have at least 2 items"}