Skip to content

Commit

Permalink
fix(acme) prepare backward compat for next lua-resty-acme release (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
fffonion authored Jun 26, 2020
1 parent 57fd400 commit b61a847
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kong/plugins/acme/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,20 @@ local function new(conf)
return nil, "account ".. conf.account_email .. " not found in storage"
end

-- backward compat
local url = conf.api_uri
if not ngx.re.match(url, "/directory$") then
if not ngx.re.match(url, "/$") then
url = url .. "/"
end
url = url .. "directory"
end

-- TODO: let acme accept initlizaed storage table alternatively
return acme.new({
account_email = conf.account_email,
account_key = account.key,
api_uri = conf.api_uri,
api_uri = url,
storage_adapter = storage_full_path,
storage_config = conf.storage_config[conf.storage],
})
Expand Down

0 comments on commit b61a847

Please sign in to comment.