mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-28 00:06:35 +08:00
优化代码
This commit is contained in:
@@ -108,10 +108,10 @@ func (this *CaptchaValidator) show(actionConfig *CaptchaAction, req requests.Req
|
||||
lang = "en-US"
|
||||
}
|
||||
|
||||
var msgTitle = ""
|
||||
var msgPrompt = ""
|
||||
var msgButtonTitle = ""
|
||||
var msgRequestId = ""
|
||||
var msgTitle string
|
||||
var msgPrompt string
|
||||
var msgButtonTitle string
|
||||
var msgRequestId string
|
||||
|
||||
switch lang {
|
||||
case "en-US":
|
||||
|
||||
@@ -40,14 +40,9 @@ func (this *CCCheckpoint) RequestValue(req requests.Request, param string, optio
|
||||
period = 7 * 86400
|
||||
}
|
||||
|
||||
v, _ := options["userType"]
|
||||
userType := types.String(v)
|
||||
|
||||
v, _ = options["userField"]
|
||||
userField := types.String(v)
|
||||
|
||||
v, _ = options["userIndex"]
|
||||
userIndex := types.Int(v)
|
||||
var userType = types.String(options["userType"])
|
||||
var userField = types.String(options["userField"])
|
||||
var userIndex = types.Int(options["userIndex"])
|
||||
|
||||
if param == "requests" { // requests
|
||||
var key = ""
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var singleParamRegexp = regexp.MustCompile("^\\${[\\w.-]+}$")
|
||||
var singleParamRegexp = regexp.MustCompile(`^\${[\w.-]+}$`)
|
||||
|
||||
// Rule
|
||||
type Rule struct {
|
||||
|
||||
@@ -45,7 +45,7 @@ func (this *WAFManager) UpdatePolicies(policies []*firewallconfigs.HTTPFirewallP
|
||||
// FindWAF 查找WAF
|
||||
func (this *WAFManager) FindWAF(policyId int64) *WAF {
|
||||
this.locker.RLock()
|
||||
w, _ := this.mapping[policyId]
|
||||
var w = this.mapping[policyId]
|
||||
this.locker.RUnlock()
|
||||
return w
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user