From 815d441dc6ea82971f22d5a08ddb3dca67464cc7 Mon Sep 17 00:00:00 2001 From: An Tran Date: Fri, 29 May 2026 13:35:10 +1000 Subject: [PATCH] perf(headers): don't render template string when delete header --- gateway/src/apicast/policy/headers/headers.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gateway/src/apicast/policy/headers/headers.lua b/gateway/src/apicast/policy/headers/headers.lua index f5553c223..dc3b85b4d 100644 --- a/gateway/src/apicast/policy/headers/headers.lua +++ b/gateway/src/apicast/policy/headers/headers.lua @@ -88,7 +88,10 @@ local command_functions = { local function run_commands(context, commands, header_type, ...) for _, command in ipairs(commands) do local command_func = command_functions[header_type][command.op] - local value = command.template_string:render(context) + local value + if command.op ~= 'delete' then + value = command.template_string:render(context) + end command_func(command.header, value, ...) end