diff --git a/CHANGELOG.md b/CHANGELOG.md index ae8fa0b3d..a4e44309a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Camel Policy: avoid unnecessary closure allocation per request [PR #1584](https://github.com/3scale/APIcast/pull/1584) - Logging Policy: construct all templates at init time [PR #1587](https://github.com/3scale/APIcast/pull/1587) - Routing Policy: eliminate unnecessary TemplateString allocation per request [PR #1585](https://github.com/3scale/APIcast/pull/1585) +- Headers Policy: don't render template string when delete header [PR #1586](https://github.com/3scale/APIcast/pull/1586) ### Fixed - Correct FAPI header to `x-fapi-interaction-id` [PR #1557](https://github.com/3scale/APIcast/pull/1557) [THREESCALE-11957](https://issues.redhat.com/browse/THREESCALE-11957) 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