Skip to content

Commit ffe5da5

Browse files
authored
Merge pull request #1586 from tkan145/perf-headers-policy
perf(headers): don't render template string when delete header
2 parents 833fb88 + 0eb3103 commit ffe5da5

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Camel Policy: avoid unnecessary closure allocation per request [PR #1584](https://github.com/3scale/APIcast/pull/1584)
1212
- Logging Policy: construct all templates at init time [PR #1587](https://github.com/3scale/APIcast/pull/1587)
1313
- Routing Policy: eliminate unnecessary TemplateString allocation per request [PR #1585](https://github.com/3scale/APIcast/pull/1585)
14+
- Headers Policy: don't render template string when delete header [PR #1586](https://github.com/3scale/APIcast/pull/1586)
1415

1516
### Fixed
1617
- 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)

gateway/src/apicast/policy/headers/headers.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ local command_functions = {
8888
local function run_commands(context, commands, header_type, ...)
8989
for _, command in ipairs(commands) do
9090
local command_func = command_functions[header_type][command.op]
91-
local value = command.template_string:render(context)
91+
local value
92+
if command.op ~= 'delete' then
93+
value = command.template_string:render(context)
94+
end
9295

9396
command_func(command.header, value, ...)
9497
end

0 commit comments

Comments
 (0)