Skip to content

Commit 99e1fea

Browse files
AlinsRanCopilot
andcommitted
fix(feishu-auth): use correct 3rd return value from admin API GET in TEST 14
The test helper t() returns (code, message, body), so the GET response body is the third return value. Using only two return values caused json.decode to receive the message string instead of the JSON body, resulting in nil dereference. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 19a8382 commit 99e1fea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

t/plugin/feishu-auth.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,10 +657,10 @@ apisix:
657657
ngx.sleep(0.1)
658658
659659
-- Admin API should return decrypted values
660-
local code2, body2 = t('/apisix/admin/routes/1', ngx.HTTP_GET)
660+
local code2, _, res2 = t('/apisix/admin/routes/1', ngx.HTTP_GET)
661661
assert(code2 == 200, "admin get route failed: " .. tostring(code2))
662-
local data = json.decode(body2)
663-
local conf = data.value.plugins["feishu-auth"]
662+
res2 = json.decode(res2)
663+
local conf = res2.value.plugins["feishu-auth"]
664664
ngx.say("admin secret_fallbacks[1]: ", conf.secret_fallbacks[1])
665665
666666
-- etcd should store encrypted values

0 commit comments

Comments
 (0)