Skip to content

Commit

Permalink
Merge pull request #586 from 3scale/loading-cloud-hosted
Browse files Browse the repository at this point in the history
fix issues failing to load APIcast Cloud Hosted policies
  • Loading branch information
davidor authored Feb 12, 2018
2 parents 20dfaa5 + 5a41618 commit e2e077f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gateway/src/apicast/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ end

local function rename_loader(name, path)
local new = map[name]
local found, err = loader(new, path)
local found, err = policy_searcher(new)

if not found then
found = policy_searcher(new)
found = loader(new, path)
end

if found then
Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local prequire = function(file)
return ok, ret
end

local name = env.get('APICAST_MODULE') or 'apicast.policy.apicast'
local name = env.value('APICAST_MODULE') or 'apicast.policy.apicast'

local ok, mod = prequire(name)

Expand Down
2 changes: 1 addition & 1 deletion gateway/src/apicast/policy/local_chain/local_chain.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ local _M = policy.new('Local Policy Chain')
local function build_default_chain()
local module

if resty_env.get('APICAST_MODULE') then
if resty_env.value('APICAST_MODULE') then
-- Needed to keep compatibility with the old module system.
module = assert(require('apicast.module'), 'could not load custom module')
else
Expand Down

0 comments on commit e2e077f

Please sign in to comment.