mirror of
https://github.com/projectdiscovery/httpx.git
synced 2024-08-16 13:00:24 +03:00
fix edge cases
This commit is contained in:
parent
de9375e643
commit
8d31a457b8
@ -91,9 +91,18 @@ func extractDomain(str string) string {
|
||||
}
|
||||
|
||||
func removeWildcards(domain string) string {
|
||||
if stringsutil.HasPrefixAny(domain, "'", "\"") {
|
||||
domain = domain[1:]
|
||||
}
|
||||
if stringsutil.HasSuffixAny(domain, "'", "\"") {
|
||||
domain = domain[:len(domain)-1]
|
||||
}
|
||||
if strings.Contains(domain, "://") {
|
||||
domain = strings.Split(domain, "://")[1]
|
||||
}
|
||||
parts := []string{}
|
||||
for _, part := range strings.Split(domain, ".") {
|
||||
if part != "*" {
|
||||
if !strings.Contains(part, "*") {
|
||||
parts = append(parts, part)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user