From b032e10dfe1bde79f8a4cb34237793cfdf7f6960 Mon Sep 17 00:00:00 2001 From: chronolaw Date: Sat, 13 Jan 2024 09:41:24 +0800 Subject: [PATCH] revert pdk.request.get_header --- kong/pdk/request.lua | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/kong/pdk/request.lua b/kong/pdk/request.lua index 624b3aa37cdc..10bb08dfe5df 100644 --- a/kong/pdk/request.lua +++ b/kong/pdk/request.lua @@ -625,23 +625,7 @@ local function new(self) error("header name must be a string", 2) end - local value = var["http_" .. replace_dashes(name)] - - if value then - local p = find(value, ", ", 1, true) -- changed since nginx 1.23.0 - - if p then - local GMT_TIME_FMT_LEN = 29 --"Mon, 28 Sep 1970 06:00:00 GMT" - - if p == 4 and #value == GMT_TIME_FMT_LEN and sub(value, -3) == "GMT" then - return value - end - - return sub(value, 1, p - 1) - end - end - - return value + return var["http_" .. replace_dashes(name)] end