Skip to content

Commit

Permalink
configuration_loader/remote_v2: use original proxy configs in index()
Browse files Browse the repository at this point in the history
  • Loading branch information
davidor committed Aug 20, 2018
1 parent 5e61322 commit f07f8f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gateway/src/apicast/configuration_loader/remote_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,19 @@ function _M:index(host)

for i=1, #proxy_configs do
local proxy_config = proxy_configs[i].proxy_config

-- Copy the config because parse_service have side-effects. It adds
-- liquid templates in some policies and those cannot be encoded into a
-- JSON. We should get rid of these side effects.
local original_proxy_config = deepcopy(proxy_config)

local service = configuration.parse_service(proxy_config.content)
local issuer, oidc_config = self:oidc_issuer_configuration(service)

if issuer then
config.oidc[i] = { issuer = issuer, config = oidc_config }
end
config.services[i] = proxy_config.content
config.services[i] = original_proxy_config.content
end

return cjson.encode(config)
Expand Down

0 comments on commit f07f8f7

Please sign in to comment.