Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warn by replace global variable with local variable #38

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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