Skip to content

Commit

Permalink
增加文件扩展名的函数处理
Browse files Browse the repository at this point in the history
  • Loading branch information
loveshell committed Apr 7, 2015
1 parent a019ff0 commit aba8bdb
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,21 @@ function whiteurl()
end
return false
end

function fileExtCheck(ext)
local items = Set(fileExtension)
if ext then
if not items[ext] then
log('POST',ngx.var.request_uri,"-","file attack with ext "..ext)
say_html()
end
end
return false
end
function Set (list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
return set
end
function args()
for _,rule in pairs(argsrules) do
local args = ngx.req.get_uri_args()
Expand Down

0 comments on commit aba8bdb

Please sign in to comment.