mirror of
https://github.com/chainreactors/spray.git
synced 2025-05-06 18:51:22 +00:00
40 lines
571 B
Go
40 lines
571 B
Go
package internal
|
|
|
|
type ErrorType uint
|
|
|
|
const (
|
|
ErrBadStatus ErrorType = iota
|
|
ErrWaf
|
|
ErrRedirect
|
|
)
|
|
|
|
func (e ErrorType) Error() string {
|
|
switch e {
|
|
case ErrBadStatus:
|
|
return "bad status"
|
|
case ErrWaf:
|
|
return "maybe ban of waf"
|
|
case ErrRedirect:
|
|
return "duplicate redirect url"
|
|
default:
|
|
return "unknown error"
|
|
}
|
|
}
|
|
|
|
type sourceType int
|
|
|
|
const (
|
|
CheckSource sourceType = iota + 1
|
|
WordSource
|
|
WafSource
|
|
)
|
|
|
|
func newUnit(path string, source sourceType) *Unit {
|
|
return &Unit{path: path, source: source}
|
|
}
|
|
|
|
type Unit struct {
|
|
path string
|
|
source sourceType
|
|
}
|