mirror of
https://github.com/projectdiscovery/httpx
synced 2026-06-08 16:50:17 +00:00
Merge pull request #2351 from projectdiscovery/2350_fix_resolver_parsing
fix resolver parsing
This commit is contained in:
+14
-1
@@ -780,9 +780,22 @@ func (options *Options) ValidateOptions() error {
|
||||
return errors.Wrapf(err, "Couldn't process resolver file \"%s\"", resolver)
|
||||
}
|
||||
for line := range chFile {
|
||||
resolvers = append(resolvers, line)
|
||||
line = strings.TrimSpace(line)
|
||||
if line != "" && strings.Contains(line, ",") {
|
||||
for item := range strings.SplitSeq(line, ",") {
|
||||
item = strings.TrimSpace(item)
|
||||
if item != "" {
|
||||
resolvers = append(resolvers, item)
|
||||
}
|
||||
}
|
||||
} else if line != "" {
|
||||
resolvers = append(resolvers, line)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if strings.ContainsAny(resolver, `/\`) {
|
||||
gologger.Warning().Msgf("Resolver argument \"%s\" looks like a file path but the file does not exist", resolver)
|
||||
}
|
||||
resolvers = append(resolvers, resolver)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user