mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-11 18:30:25 +08:00
增强安全性
This commit is contained in:
@@ -109,6 +109,12 @@ func NewUserMustAuth(module string) *userMustAuth {
|
||||
func (this *userMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramName string) (goNext bool) {
|
||||
var action = actionPtr.Object()
|
||||
|
||||
// 检查请求是否合法
|
||||
if isEvilRequest(action.Request) {
|
||||
action.ResponseWriter.WriteHeader(http.StatusForbidden)
|
||||
return false
|
||||
}
|
||||
|
||||
// 恢复模式
|
||||
if teaconst.IsRecoverMode {
|
||||
action.RedirectURL("/recover")
|
||||
|
||||
Reference in New Issue
Block a user