mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-10 01:10:29 +08:00
增强安全性
This commit is contained in:
@@ -21,6 +21,12 @@ func (this *UserShouldAuth) BeforeAction(actionPtr actions.ActionWrapper, paramN
|
||||
|
||||
this.action = actionPtr.Object()
|
||||
|
||||
// 检查请求是否合法
|
||||
if isEvilRequest(this.action.Request) {
|
||||
this.action.ResponseWriter.WriteHeader(http.StatusForbidden)
|
||||
return false
|
||||
}
|
||||
|
||||
// 安全相关
|
||||
var action = this.action
|
||||
securityConfig, _ := configloaders.LoadSecurityConfig()
|
||||
|
||||
Reference in New Issue
Block a user