pull/216/head
midoks 3 years ago
parent 7bdcd0ac2b
commit 444ff40570
  1. 4
      plugins/op_waf/t/index.py
  2. 14
      plugins/op_waf/waf/html/safe_js.html
  3. 3
      plugins/op_waf/waf/lua/common.lua
  4. 15
      plugins/op_waf/waf/lua/init.lua

@ -212,10 +212,10 @@ def test_start():
# test_OK()
# test_Dir()
# test_UA()
test_UA_for(1000)
# test_UA_for(1000)
# test_POST()
# test_scan()
# test_CC()
test_CC()
# test_url_ext()
# test_cdn()

@ -125,14 +125,14 @@ function ajax(type,bool){
return xhr;
}
var ok = setInterval(function(){
ajax('JSON',true).post('{uri}',{'pass':"ok"},function(data){
if (data['status'] == 0){
location.reload();
}
});
ajax('JSON',true).post('{uri}',{'pass':"ok"}, function(data){
if (data['status'] == 0){
document.getElementById('status').innerHTML = 'ok';
location.reload();
}
});
var ok = setInterval(function(){
var id = document.getElementById('change').innerHTML;
id = id - 1;
if (id == 0){

@ -180,7 +180,10 @@ end
function _M.return_message(self, status, msg)
ngx.header.content_type = "application/json"
self:D("return_message:"..tostring(status)..tostring(msg))
local data = self:return_state(status, msg)
self:D("return_message[data]:"..tostring(data))
ngx.say(json.encode(data))
ngx.exit(200)
end

@ -62,6 +62,15 @@ local function get_waf_drop_ip()
return data
end
local function return_json(status,msg)
ngx.header.content_type = "application/json"
result = {}
result['status'] = status
result['msg'] = msg
ngx.say(json.encode(data))
ngx.exit(200)
end
local function is_chekc_table(data,strings)
if type(data) ~= 'table' then return 1 end
if not data then return 1 end
@ -308,8 +317,10 @@ local function waf_cc_increase()
if params['uri_request_args']['token'] then
local args_token = params['uri_request_args']['token']
if args_token == make_token then
ngx.shared.waf_limit:set(cache_token,1, config['safe_verify']['time'])
C:return_message(0,'ok')
ngx.shared.waf_limit:set(cache_token, 1, config['safe_verify']['time'])
local data = get_return_state(0, "ok")
ngx.say(json.encode(data))
ngx.exit(200)
end
end

Loading…
Cancel
Save