Lua 在OpenResty中解析头文件?

Lua 在OpenResty中解析头文件?,lua,openresty,Lua,Openresty,我有一个Lua脚本用于实现GoogleOAuth 我目前正在添加另一个绕过OAuth的逻辑分支: local auth_header = ngx.header["Authorization"] or "UNSET" -- if a valid API key exists, use it rather than the OAuth login flow ngx.log(ngx.ERR, "DEBUG: " .. auth_header) if api_key ~= "UNSET" and aut

我有一个Lua脚本用于实现GoogleOAuth

我目前正在添加另一个绕过OAuth的逻辑分支:

local auth_header = ngx.header["Authorization"] or "UNSET"
-- if a valid API key exists, use it rather than the OAuth login flow
ngx.log(ngx.ERR, "DEBUG: " .. auth_header)
if api_key ~= "UNSET" and auth_header == api_key then
  return
end
但是,标题似乎总是设置为空白:

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"
我错过什么了吗?有没有我不知道的另一种方法可以访问OpenResty中的头文件