httpx/common/customlist/customlist.go

21 lines
465 B
Go
Raw Normal View History

2021-04-09 00:11:41 +03:00
package customlist
import "github.com/projectdiscovery/httpx/common/fileutil"
const maxRecursion = 10
2021-04-09 00:11:41 +03:00
// CustomList for fastdialer
type CustomList []string
// String returns just a label
func (c *CustomList) String() string {
return "Custom Global List"
}
// Set a new global header
func (c *CustomList) Set(value string) error {
values := fileutil.LoadCidrsFromSliceOrFileWithMaxRecursion(value, ",", maxRecursion)
*c = append(*c, values...)
2021-04-09 00:11:41 +03:00
return nil
}