mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
增强安全性
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/events"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
@@ -155,3 +157,9 @@ func checkRequestSecurity(securityConfig *systemconfigs.SecurityConfig, req *htt
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// 检查是否为禁止的请求
|
||||
func isEvilRequest(req *http.Request) bool {
|
||||
var headersJSON, _ = json.Marshal(req.Header)
|
||||
return bytes.Contains(headersJSON, []byte("fofa."))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user