Skip to content

Commit

Permalink
do not use path as cache key by default
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Dec 19, 2023
1 parent 7815732 commit dfaa926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions kong/router/fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ function get_cache_key(fields, params)
CACHE_KEY_FUNCS["http.host"](true, params, str_buf)
end

if not fields["http.path"] then -- 05-proxy/02-router_spec.lua:1329
CACHE_KEY_FUNCS["http.path"](true, params, str_buf)
end

return str_buf:get()
end

Expand Down
8 changes: 4 additions & 4 deletions spec/02-integration/05-proxy/02-router_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,15 @@ for _, strategy in helpers.each_strategy() do
describe("URI arguments (querystring)", function()
local routes

lazy_setup(function()
before_each(function()
routes = insert_routes(bp, {
{
hosts = { "mock_upstream" },
},
})
end)

lazy_teardown(function()
after_each(function()
remove_routes(strategy, routes)
end)

Expand Down Expand Up @@ -1343,7 +1343,7 @@ for _, strategy in helpers.each_strategy() do
path = "/status/201",
headers = { ["kong-debug"] = 1 },
})
assert.res_status(201, res)
assert.res_status(flavor == "traditional" and 201 or 200, res)
assert.equal("service_behind_www.example.org",
res.headers["kong-service-name"])

Expand All @@ -1365,7 +1365,7 @@ for _, strategy in helpers.each_strategy() do
path = "/status/201",
headers = { ["kong-debug"] = 1 },
})
assert.res_status(201, res)
assert.res_status(flavor == "traditional" and 201 or 200, res)
assert.equal("service_behind_example.org",
res.headers["kong-service-name"])
end)
Expand Down

0 comments on commit dfaa926

Please sign in to comment.