mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-05 17:40:26 +08:00
验证码验证不区分访问路径
This commit is contained in:
@@ -4,7 +4,6 @@ package waf
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
|
||||||
"github.com/TeaOSLab/EdgeNode/internal/utils"
|
|
||||||
"github.com/TeaOSLab/EdgeNode/internal/utils/counters"
|
"github.com/TeaOSLab/EdgeNode/internal/utils/counters"
|
||||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||||
"github.com/iwind/TeaGo/types"
|
"github.com/iwind/TeaGo/types"
|
||||||
@@ -45,14 +44,5 @@ func CaptchaDeleteCacheKey(req requests.Request) {
|
|||||||
|
|
||||||
// CaptchaCacheKey 获取Captcha缓存Key
|
// CaptchaCacheKey 获取Captcha缓存Key
|
||||||
func CaptchaCacheKey(req requests.Request, pageCode CaptchaPageCode) string {
|
func CaptchaCacheKey(req requests.Request, pageCode CaptchaPageCode) string {
|
||||||
var requestPath = req.WAFRaw().URL.Path
|
return "WAF:CAPTCHA:FAILS:" + pageCode + ":" + req.WAFRemoteIP() + ":" + types.String(req.WAFServerId())
|
||||||
|
|
||||||
if req.WAFRaw().URL.Path == CaptchaPath {
|
|
||||||
m, err := utils.SimpleDecryptMap(req.WAFRaw().URL.Query().Get("info"))
|
|
||||||
if err == nil && m != nil {
|
|
||||||
requestPath = m.GetString("url")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "WAF:CAPTCHA:FAILS:" + pageCode + ":" + req.WAFRemoteIP() + ":" + types.String(req.WAFServerId()) + ":" + requestPath
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user