mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-20 04:50:26 +08:00
优化WAF性能
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Checkpoint struct {
|
||||
}
|
||||
|
||||
@@ -30,3 +35,16 @@ func (this *Checkpoint) Start() {
|
||||
func (this *Checkpoint) Stop() {
|
||||
|
||||
}
|
||||
|
||||
func (this *Checkpoint) RequestBodyIsEmpty(req requests.Request) bool {
|
||||
if req.WAFRaw().ContentLength == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
var method = req.WAFRaw().Method
|
||||
if method == http.MethodHead || method == http.MethodGet {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user