Skip to content

Commit b61de24

Browse files
feat: 修改 waf 规则
1 parent 8bc2fe0 commit b61de24

File tree

1 file changed

+2
-29
lines changed
  • apps/openresty/versions/1.21.4/www/common/waf

1 file changed

+2
-29
lines changed

apps/openresty/versions/1.21.4/www/common/waf/access.lua

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,31 +56,6 @@ local function log(method,url,data,ruletag)
5656
end
5757
end
5858
------------------------------------规则读取函数-------------------------------------------------------------------
59-
--local function read_rule(var)
60-
-- file = io.open(rulepath..'/'..var,"r")
61-
-- if file==nil then
62-
-- return
63-
-- end
64-
-- t = {}
65-
-- for line in file:lines() do
66-
-- table.insert(t,line)
67-
-- end
68-
-- file:close()
69-
-- return(t)
70-
--end
71-
72-
--local function read_json(var)
73-
-- file = io.open(rulepath..'/'..var,"r")
74-
-- if file==nil then
75-
-- return
76-
-- end
77-
-- str = file:read("*a")
78-
-- file:close()
79-
-- list = cjson.decode(str)
80-
-- return list
81-
--end
82-
83-
8459
local function read_json(var)
8560
file = io.open(rulepath..'/'..var .. '.json',"r")
8661
if file==nil then
@@ -92,14 +67,12 @@ local function read_json(var)
9267
return list
9368
end
9469

95-
9670
local function select_rules(rules)
9771
if not rules then return {} end
9872
new_rules = {}
9973
for i,v in ipairs(rules) do
100-
if v[1] == 1 then
101-
print("111")
102-
table.insert(new_rules,v[2])
74+
if v[3] == 1 then
75+
table.insert(new_rules,v[1])
10376
end
10477
end
10578
return new_rules

0 commit comments

Comments
 (0)