Skip to content

Commit

Permalink
Only overwrite opts.discovery when calling endpoint actually succeeds
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Bodewig <stefan.bodewig@innoq.com>
  • Loading branch information
bodewig committed Mar 6, 2019
1 parent 4fbfd9b commit 1fec029
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
03/06/2019
- don't overwrite opts.discovery when an error occurs calling the
discovery endpoint; see #250

02/18/2019
- release 1.7.1

Expand Down
8 changes: 6 additions & 2 deletions lib/resty/openidc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,12 @@ end
local function openidc_ensure_discovered_data(opts)
local err
if type(opts.discovery) == "string" then
opts.discovery, err = openidc_discover(opts.discovery, opts.ssl_verify, opts.timeout, opts.jwk_expires_in, opts.proxy_opts,
opts.http_request_decorator)
local discovery
discovery, err = openidc_discover(opts.discovery, opts.ssl_verify, opts.timeout, opts.jwk_expires_in, opts.proxy_opts,
opts.http_request_decorator)
if not err then
opts.discovery = discovery
end
end
return err
end
Expand Down

0 comments on commit 1fec029

Please sign in to comment.