From 9159217f7bb8e1e8d8e2b889724905f50ef40e74 Mon Sep 17 00:00:00 2001 From: xumin Date: Mon, 13 Nov 2023 16:36:25 +0800 Subject: [PATCH] chore(pdk): doc a known issue of get_headers() Adressing KAG-2602, #11546 --- 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 7a47419f96fb..c0eaf41bb1d3 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 oprand of #. function response.get_headers(max_headers) check_phase(header_body_log)