mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Initial support for Lua script engine
This commit is contained in:
19
test/test-cases/data/match-getvar.lua
Normal file
19
test/test-cases/data/match-getvar.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
function main()
|
||||
ret = nil
|
||||
|
||||
num = m.getvar("tx.test");
|
||||
if num == nil then
|
||||
m.log(9, "Don't know what to say about this so called number.");
|
||||
return ret
|
||||
end
|
||||
num = tonumber(num)
|
||||
|
||||
if num > 1 then
|
||||
m.log(9, "Number is bigger than one.");
|
||||
ret = "Whee :)"
|
||||
else
|
||||
m.log(9, "Really?");
|
||||
end
|
||||
|
||||
return ret
|
||||
end
|
Reference in New Issue
Block a user