Skip to content

Commit

Permalink
policy_loader: fix building of the cache key in call()
Browse files Browse the repository at this point in the history
The code was not taking into account that 'dir' is a table.
  • Loading branch information
davidor authored and mikz committed Jun 18, 2018
1 parent 40ec7ed commit 835ef42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gateway/src/apicast/policy_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local format = string.format
local ipairs = ipairs
local pairs = pairs
local insert = table.insert
local concat = table.concat
local setmetatable = setmetatable
local pcall = pcall

Expand Down Expand Up @@ -140,7 +141,9 @@ function _M:call(name, version, dir)
local v = version or 'builtin'
local load_path, policy_config_schema, invalid_paths = self:load_path(name, v, dir)

local cache = package_cache[table.concat({name, v, dir}, '-')]
local cache_key = concat({name, v, dir and concat(dir, ',') or '' }, '-')

local cache = package_cache[cache_key]
local loader = sandbox.new(load_path and { load_path } or invalid_paths,
cache)

Expand Down

0 comments on commit 835ef42

Please sign in to comment.