Skip to content

Commit

Permalink
[TMA-630][haoliu & llr] Make pcall right.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexuscream committed Feb 26, 2019
1 parent 49a6613 commit 9314e5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion kong/plugins/okta-auth/access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ local function make_oidc(token_data)
ngx.log(ngx.DEBUG, " Get Oidc label Success. oidc_label: ", oidc_label)
else
ngx.log(ngx.ERR, " Get Oidc label failed.")
oidc_label = ''
oidc_label = " "
end

oidc["Lab"] = oidc_label
Expand Down
8 changes: 4 additions & 4 deletions kong/plugins/okta-auth/okta_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ local function fetch_objc_label(oidc_id)

local url = base_url .. '/api/v1/apps/' .. oidc_id
local headers = get_Oidc_headers()
local pok, status_code, response_body, response_headers = pcall(send_request(
local pok, status, response_body, response_headers = pcall(send_request,
url, "GET", headers, body_params
))
)

if not pok or status_code ~= 200 or not response_body then
ngx.log(ngx.ERR, "Assemble OIDC Label failed with :status_code ", status_code)
if not pok or status ~= 200 or not response_body then
ngx.log(ngx.ERR, "Assemble OIDC Label failed, because ", status)
return nil
end

Expand Down

0 comments on commit 9314e5c

Please sign in to comment.