Skip to content

Commit

Permalink
Fix warn by replace global variable with local variable (#38)
Browse files Browse the repository at this point in the history
Signed-off-by: clyang82 <[email protected]>
  • Loading branch information
clyang82 authored Sep 6, 2021
1 parent 8e4be31 commit e1391b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rootfs/opt/ibm/router/nginx/conf/oauthproxy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ local function validate_access_token_or_exit()

if auth_header ~= nil then
ngx.log(ngx.NOTICE, "Authorization header found. Attempt to extract token.")
_, _, token = string.find(auth_header, "Bearer%s+(.+)")
local _, _, bearer_token = string.find(auth_header, "Bearer%s+(.+)")
token = bearer_token
end

if token == nil then
Expand All @@ -89,7 +90,7 @@ local function validate_access_token_or_exit()

-- attempt to set forwared token in cookie as well, if not already set
local cookie, err = cookiejar:new()
access_token_cookie = cookie:get("acm-access-token-cookie")
local access_token_cookie = cookie:get("acm-access-token-cookie")
if access_token_cookie == nil then
ngx.log(ngx.NOTICE, "acm-access-token-cookie not found,setting it.")
-- set cookie, max age 12h in seconds
Expand Down

0 comments on commit e1391b7

Please sign in to comment.