2020-10-08 15:06:42 +08:00
|
|
|
package checkpoints
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeNode/internal/waf/requests"
|
2020-11-18 19:35:38 +08:00
|
|
|
"github.com/iwind/TeaGo/maps"
|
2020-10-08 15:06:42 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ${responseHeader.arg}
|
|
|
|
|
type ResponseHeaderCheckpoint struct {
|
|
|
|
|
Checkpoint
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (this *ResponseHeaderCheckpoint) IsRequest() bool {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-18 19:35:38 +08:00
|
|
|
func (this *ResponseHeaderCheckpoint) RequestValue(req *requests.Request, param string, options maps.Map) (value interface{}, sysErr error, userErr error) {
|
2020-10-08 15:06:42 +08:00
|
|
|
value = ""
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-18 19:35:38 +08:00
|
|
|
func (this *ResponseHeaderCheckpoint) ResponseValue(req *requests.Request, resp *requests.Response, param string, options maps.Map) (value interface{}, sysErr error, userErr error) {
|
2020-10-08 15:06:42 +08:00
|
|
|
if resp != nil && resp.Header != nil {
|
|
|
|
|
value = resp.Header.Get(param)
|
|
|
|
|
} else {
|
|
|
|
|
value = ""
|
|
|
|
|
}
|
|
|
|
|
return
|
|
|
|
|
}
|