Allow URI without trailing /

This commit is contained in:
Kload 2013-10-29 11:53:22 +00:00
parent 0f45cd4b0f
commit ec61f68df6

View file

@ -120,7 +120,7 @@ function has_access (user, url)
user = user or ngx.var.cookie_SSOwAuthUser user = user or ngx.var.cookie_SSOwAuthUser
url = url or ngx.var.host..ngx.var.uri url = url or ngx.var.host..ngx.var.uri
for u, _ in pairs(conf["users"][user]) do for u, _ in pairs(conf["users"][user]) do
if string.starts(url, u) then return true end if string.starts(url, string.sub(u, 1, -2)) then return true end
end end
return false return false
end end