WAF参数定义增加优先级,可以让“轻”任务优先执行

This commit is contained in:
GoEdgeLab
2022-10-24 17:57:07 +08:00
parent 487d7015b7
commit 9e720bd0c5
7 changed files with 76 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import (
)
type Checkpoint struct {
priority int
}
func (this *Checkpoint) Init() {
@@ -36,6 +37,14 @@ func (this *Checkpoint) Stop() {
}
func (this *Checkpoint) SetPriority(priority int) {
this.priority = priority
}
func (this *Checkpoint) Priority() int {
return this.priority
}
func (this *Checkpoint) RequestBodyIsEmpty(req requests.Request) bool {
if req.WAFRaw().ContentLength == 0 {
return true