Skip to content

Commit c142ad1

Browse files
committed
removed hostname cleaning due to too many bugs, added make install
1 parent a061d59 commit c142ad1

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ endif
3838
fmt:
3939
gofmt -s -w -l .
4040

41+
install: $(SOURCES) $(ALL_SOURCES)
42+
go install $(BUILD_FLAGS)
43+
4144
clean:
4245
rm -r certgraph build/
4346

certgraph.go

+2-22
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"encoding/json"
55
"flag"
66
"fmt"
7-
"net"
8-
"net/url"
97
"os"
108
"strings"
119
"sync"
@@ -111,7 +109,8 @@ func main() {
111109
startDomains := make([]string, 0, 1)
112110

113111
for _, domain := range flag.Args() {
114-
d := cleanHostName(strings.ToLower(domain))
112+
d := strings.ToLower(domain)
113+
v("cleaned", domain, d)
115114
if len(d) > 0 {
116115
startDomains = append(startDomains, d)
117116
v("clean", d)
@@ -321,22 +320,3 @@ func visitSSL(node *graph.DomainNode) {
321320
node.VisitedCert = certnode.Fingerprint
322321
}
323322
}
324-
325-
// sanitize the input to accept urls
326-
func cleanHostName(host string) string {
327-
u, err := url.Parse(host)
328-
if err != nil {
329-
v(err)
330-
return ""
331-
}
332-
host = u.Host
333-
334-
if strings.Contains(host, ":") {
335-
host, _, err = net.SplitHostPort(host)
336-
if err != nil {
337-
v(err)
338-
return ""
339-
}
340-
}
341-
return host
342-
}

0 commit comments

Comments
 (0)