Files
EdgeNode/internal/waf/requests/request.go

53 lines
1.0 KiB
Go
Raw Normal View History

2020-10-08 15:06:42 +08:00
package requests
import (
"net/http"
)
2021-07-18 15:51:49 +08:00
type Request interface {
// WAFRaw 原始请求
WAFRaw() *http.Request
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// WAFRemoteIP 客户端IP
WAFRemoteIP() string
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// WAFGetCacheBody 获取缓存中的Body
WAFGetCacheBody() []byte
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// WAFSetCacheBody 设置Body
WAFSetCacheBody(body []byte)
// WAFReadBody 读取Body
WAFReadBody(max int64) (data []byte, err error)
// WAFRestoreBody 恢复Body
WAFRestoreBody(data []byte)
2020-10-08 15:06:42 +08:00
2021-07-18 15:51:49 +08:00
// WAFServerId 服务ID
WAFServerId() int64
2021-07-19 10:49:56 +08:00
2021-09-29 11:06:00 +08:00
// WAFClose 关闭当前请求所在的连接
WAFClose()
// WAFOnAction 动作回调
2023-10-11 12:21:10 +08:00
WAFOnAction(action any) (goNext bool)
2023-03-08 16:59:44 +08:00
// WAFFingerprint 读取连接指纹
WAFFingerprint() []byte
// WAFMaxRequestSize 可以检查的最大内容尺寸
WAFMaxRequestSize() int64
2021-07-19 10:49:56 +08:00
// Format 格式化变量
Format(string) string
// ProcessResponseHeaders 处理响应Header
ProcessResponseHeaders(headers http.Header, status int)
// DisableAccessLog 在当前请求中不使用访问日志
DisableAccessLog()
2023-11-19 09:10:37 +08:00
// DisableStat 在当前请求中停用统计
DisableStat()
2020-10-08 15:06:42 +08:00
}