mirror of
https://github.com/YunoHost/SSOwat.git
synced 2024-09-03 20:06:27 +02:00
Forbid acces to directory root
This commit is contained in:
parent
cec0ca6959
commit
0ddd88c409
1 changed files with 6 additions and 0 deletions
|
@ -154,6 +154,12 @@ function serve(uri)
|
|||
rel_path = "/login.html"
|
||||
end
|
||||
|
||||
-- Access to directory root: forbidden
|
||||
if string.ends(rel_path, "/") then
|
||||
return ngx.exit(403)
|
||||
end
|
||||
|
||||
-- Try to get file content
|
||||
content = read_file(script_path.."portal"..rel_path)
|
||||
if not content then
|
||||
return ngx.exit(ngx.HTTP_NOT_FOUND)
|
||||
|
|
Loading…
Reference in a new issue