Skip to content

Commit

Permalink
url: must contain a domain or an ip
Browse files Browse the repository at this point in the history
  • Loading branch information
assafmo committed Jan 21, 2019
1 parent b1e7ee1 commit c0ffa79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xioc/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ func ExtractURLs(text string) []string {
url = strings.Replace(url, ":// ", "://", -1)
url = strings.Replace(url, "[com]", "com", -1)

if !strings.Contains(url, ".") && // check for domain without mutual calls
len(ExtractIPv4s(url)) == 0 &&
len(ExtractIPv6s(url)) == 0 {
continue
}

if !resultSet[url] {
resultSet[url] = true
Expand Down
2 changes: 2 additions & 0 deletions xioc/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,4 +555,6 @@
"urls": ["http://feeds.rapidfeeds.com/88604/"],
"domains": ["feeds.rapidfeeds.com"]
},
"ed to enter http:// or https:// or www.). Clic": {},
"http://:": {}
}

0 comments on commit c0ffa79

Please sign in to comment.