mirror of
https://github.com/chaitin/SafeLine.git
synced 2026-01-31 13:53:33 +08:00
fix: tonumber
This commit is contained in:
21
sdk/kong/kong-safeline-1.0.3-1.rockspec
Normal file
21
sdk/kong/kong-safeline-1.0.3-1.rockspec
Normal file
@@ -0,0 +1,21 @@
|
||||
package = "kong-safeline"
|
||||
version = "1.0.3-1"
|
||||
source = {
|
||||
url = "git://github.com/xbingW/kong-safeline.git"
|
||||
}
|
||||
description = {
|
||||
summary = "Kong plugin for Chaitin SafeLine Web Application Firewall",
|
||||
homepage = "https://github.com/xbingW/kong-safeline",
|
||||
license = "Apache License 2.0",
|
||||
maintainer = "Xiaobing Wang <xiaobing.wang@chaitin.com>"
|
||||
}
|
||||
dependencies = {
|
||||
"lua-resty-t1k >= 1.1.5"
|
||||
}
|
||||
build = {
|
||||
type = "builtin",
|
||||
modules = {
|
||||
["kong.plugins.safeline.handler"] = "kong/plugins/safeline/handler.lua",
|
||||
["kong.plugins.safeline.schema"] = "kong/plugins/safeline/schema.lua"
|
||||
}
|
||||
}
|
||||
@@ -34,11 +34,11 @@ function SafelineHandler:access(conf)
|
||||
if not ok then
|
||||
kong.log.err("failed to detector req: ", err)
|
||||
end
|
||||
if result then
|
||||
if result and result.status then
|
||||
if result.action == t1k_constants.ACTION_BLOCKED then
|
||||
local msg = fmt(blocked_message, result.status, result.event_id)
|
||||
kong.log.debug("blocked by safeline: ",msg)
|
||||
return kong.response.exit(result.status, msg)
|
||||
return kong.response.exit(tonumber(result.status), msg)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user