Files
EdgeCommon/pkg/serverconfigs/firewallconfigs/http_firewall_action_block.go

23 lines
666 B
Go
Raw Normal View History

2020-10-06 21:02:21 +08:00
package firewallconfigs
2022-05-21 18:57:59 +08:00
import "net/http"
2021-07-14 22:46:31 +08:00
// HTTPFirewallBlockAction url client configure
2020-10-06 21:02:21 +08:00
type HTTPFirewallBlockAction struct {
IsPrior bool `yaml:"isPrior" json:"isPrior"`
2021-10-19 10:28:18 +08:00
StatusCode int `yaml:"statusCode" json:"statusCode"`
Body string `yaml:"body" json:"body"` // supports HTML
URL string `yaml:"url" json:"url"`
Timeout int32 `yaml:"timeout" json:"timeout"`
Scope FirewallScope `yaml:"scope" json:"scope"`
2020-10-06 21:02:21 +08:00
}
2022-05-21 18:57:59 +08:00
func DefaultHTTPFirewallBlockAction() *HTTPFirewallBlockAction {
return &HTTPFirewallBlockAction{
StatusCode: http.StatusForbidden,
Body: "Blocked By WAF",
Timeout: 300,
2022-05-21 18:57:59 +08:00
}
}