Skip to content

Commit

Permalink
Revert "fix(proxy-cache): changes age param (#12812)"
Browse files Browse the repository at this point in the history
This reverts commit 4707465.
  • Loading branch information
jschmid1 committed Jul 23, 2024
1 parent 44ecc32 commit 5eac36b
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 71 deletions.
3 changes: 0 additions & 3 deletions changelog/unreleased/kong/fix-age-header.yml

This file was deleted.

1 change: 0 additions & 1 deletion kong-3.8.0-0.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ build = {
["kong.plugins.proxy-cache.api"] = "kong/plugins/proxy-cache/api.lua",
["kong.plugins.proxy-cache.strategies"] = "kong/plugins/proxy-cache/strategies/init.lua",
["kong.plugins.proxy-cache.strategies.memory"] = "kong/plugins/proxy-cache/strategies/memory.lua",
["kong.plugins.proxy-cache.clustering.compat.response_headers_translation"] = "kong/plugins/proxy-cache/clustering/compat/response_headers_translation.lua",

["kong.plugins.grpc-web.deco"] = "kong/plugins/grpc-web/deco.lua",
["kong.plugins.grpc-web.handler"] = "kong/plugins/grpc-web/handler.lua",
Expand Down
12 changes: 0 additions & 12 deletions kong/clustering/compat/checkers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@ local compatible_checkers = {
{ 3008000000, --[[ 3.8.0.0 ]]
function (config_table, dp_version, log_suffix)
local has_update
local adapter = require("kong.plugins.proxy-cache.clustering.compat.response_headers_translation").adapter
for _, plugin in ipairs(config_table.plugins or {}) do
if plugin.name == 'proxy-cache' then
has_update = adapter(plugin.config)
if has_update then
log_warn_message('adapts ' .. plugin.name .. ' plugin response_headers configuration to older version',
'revert to older schema',
dp_version, log_suffix)
end
end
end

for _, plugin in ipairs(config_table.plugins or {}) do
if plugin.name == 'aws-lambda' then
local config = plugin.config
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion kong/plugins/proxy-cache/schema.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ return {
description = "Caching related diagnostic headers that should be included in cached responses",
type = "record",
fields = {
{ ["Age"] = {type = "boolean", default = true} },
{ age = {type = "boolean", default = true} },
{ ["X-Cache-Status"] = {type = "boolean", default = true} },
{ ["X-Cache-Key"] = {type = "boolean", default = true} },
},
Expand Down
40 changes: 0 additions & 40 deletions spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,46 +479,6 @@ describe("CP/DP config compat transformations #" .. strategy, function()
admin.plugins:remove({ id = response_rl.id })
end)
end)

describe("proxy-cache plugin", function()
it("rename age field in response_headers config from age to Age", function()
-- [[ 3.8.x ]] --
local response_rl = admin.plugins:insert {
name = "proxy-cache",
enabled = true,
config = {
response_code = { 200, 301, 404 },
request_method = { "GET", "HEAD" },
content_type = { "text/plain", "application/json" },
cache_ttl = 300,
strategy = "memory",
cache_control = false,
memory = {
dictionary_name = "kong_db_cache",
},
-- [[ age field renamed to Age
response_headers = {
["Age"] = true,
["X-Cache-Status"] = true,
["X-Cache-Key"] = true
}
-- ]]
}
}

local expected_response_rl_prior_38 = cycle_aware_deep_copy(response_rl)
expected_response_rl_prior_38.config.response_headers = {
["age"] = true,
["X-Cache-Status"] = true,
["X-Cache-Key"] = true
}

do_assert(uuid(), "3.7.0", expected_response_rl_prior_38)

-- cleanup
admin.plugins:remove({ id = response_rl.id })
end)
end)
end)

describe("ai plugins", function()
Expand Down
2 changes: 1 addition & 1 deletion spec/03-plugins/31-proxy-cache/02-access_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ do
content_type = { "text/plain", "application/json" },
[policy] = policy_config,
response_headers = {
["Age"] = false,
age = false,
["X-Cache-Status"] = false,
["X-Cache-Key"] = false
},
Expand Down

0 comments on commit 5eac36b

Please sign in to comment.