From fbcec4565ede99ba2019aca90beb0abcae33744e Mon Sep 17 00:00:00 2001 From: Xumin <100666470+StarlightIbuki@users.noreply.github.com> Date: Tue, 14 Nov 2023 10:52:49 +0000 Subject: [PATCH] chore(pdk): doc a known issue of get_headers() (#12006) Adressing KAG-2602, #11546 Co-authored-by: Datong Sun --- kong/pdk/service/response.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kong/pdk/service/response.lua b/kong/pdk/service/response.lua index 7a47419f96f..ec51fe4fac0 100644 --- a/kong/pdk/service/response.lua +++ b/kong/pdk/service/response.lua @@ -198,6 +198,8 @@ local function new(pdk, major_version) -- kong.log.inspect(headers.x_another[1]) -- "foo bar" -- kong.log.inspect(headers["X-Another"][2]) -- "baz" -- end + -- Note that this function returns a proxy table + -- which cannot be iterated with `pairs` or used as operand of `#`. function response.get_headers(max_headers) check_phase(header_body_log)