mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-25 16:30:25 +08:00
实现WAF
This commit is contained in:
27
internal/waf/checkpoints/response_bytes_sent.go
Normal file
27
internal/waf/checkpoints/response_bytes_sent.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package checkpoints
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
||||
)
|
||||
|
||||
// ${bytesSent}
|
||||
type ResponseBytesSentCheckpoint struct {
|
||||
Checkpoint
|
||||
}
|
||||
|
||||
func (this *ResponseBytesSentCheckpoint) IsRequest() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (this *ResponseBytesSentCheckpoint) RequestValue(req *requests.Request, param string, options map[string]interface{}) (value interface{}, sysErr error, userErr error) {
|
||||
value = 0
|
||||
return
|
||||
}
|
||||
|
||||
func (this *ResponseBytesSentCheckpoint) ResponseValue(req *requests.Request, resp *requests.Response, param string, options map[string]interface{}) (value interface{}, sysErr error, userErr error) {
|
||||
value = 0
|
||||
if resp != nil {
|
||||
value = resp.ContentLength
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user