mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-07 18:50:27 +08:00
51 lines
754 B
Go
51 lines
754 B
Go
package checkpoints
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
|
"net/http"
|
|
)
|
|
|
|
type Checkpoint struct {
|
|
}
|
|
|
|
func (this *Checkpoint) Init() {
|
|
|
|
}
|
|
|
|
func (this *Checkpoint) IsRequest() bool {
|
|
return true
|
|
}
|
|
|
|
func (this *Checkpoint) IsComposed() bool {
|
|
return false
|
|
}
|
|
|
|
func (this *Checkpoint) ParamOptions() *ParamOptions {
|
|
return nil
|
|
}
|
|
|
|
func (this *Checkpoint) Options() []OptionInterface {
|
|
return nil
|
|
}
|
|
|
|
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
|
|
}
|