Skip to content

Commit

Permalink
nice error when lua_shared_dict is not configured
Browse files Browse the repository at this point in the history
it will help #7
  • Loading branch information
prigaux committed Mar 11, 2021
1 parent 6112076 commit a2be8ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ local function init()
cookie_params = conf.cookie_params or "; Path=/; Secure; HttpOnly"
REMOTE_USER_header = conf.REMOTE_USER_header or "REMOTE_USER"
session_lifetime = conf.session_lifetime or 3600
store = ngx.shared[conf.store_name or "cas_store"]
local store_name = conf.store_name or "cas_store"
store = ngx.shared[store_name]
if store == nil then
ngx.log(ngx.ERR, 'you must configure "lua_shared_dict ' .. store_name .. '"')
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end
end

local function _to_table(v)
Expand Down

0 comments on commit a2be8ef

Please sign in to comment.