2021-04-09 00:11:41 +03:00
|
|
|
package customlist
|
|
|
|
|
2021-08-22 22:07:23 +03:00
|
|
|
import "github.com/projectdiscovery/httpx/common/fileutil"
|
|
|
|
|
2021-10-16 15:37:54 +03:00
|
|
|
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 {
|
2021-10-16 15:37:54 +03:00
|
|
|
values := fileutil.LoadCidrsFromSliceOrFileWithMaxRecursion(value, ",", maxRecursion)
|
2021-08-22 22:07:23 +03:00
|
|
|
*c = append(*c, values...)
|
2021-04-09 00:11:41 +03:00
|
|
|
return nil
|
|
|
|
}
|