lua - Parse Headers in OpenResty? -
i have script in lua implementing google oauth.
i working on adding branch of logic bypasses oauth:
local auth_header = ngx.header["authorization"] or "unset" -- if valid api key exists, use rather oauth login flow ngx.log(ngx.err, "debug: " .. auth_header) if api_key ~= "unset" , auth_header == api_key return end
however, appears header set blank:
2017/09/12 01:33:28 [error] 16494#16494: *109 [lua] google_oauth.lua:57: debug: unset, client: 1.2.3.4, server: resty, request: "get /images/favicon.ico?1487269154 http/1.1", host: "resty", referrer: "https://resty/sessions/new"
am missing something? there way access headers in openresty i'm unaware of?
Comments
Post a Comment