增强安全性

This commit is contained in:
GoEdgeLab
2024-03-18 11:45:13 +08:00
parent 3c3777a08f
commit b31e26740e
4 changed files with 24 additions and 0 deletions

View File

@@ -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()