diff --git a/spider.go b/spider.go index 365d517..3d3a590 100644 --- a/spider.go +++ b/spider.go @@ -62,12 +62,12 @@ func Pages(base string) <-chan Link { for len(links) > 0 { l := links[0] links = links[1:] - if !(strings.HasPrefix(l.To, base) || strings.HasPrefix(l.To, "/")) { - continue - } - if !strings.HasPrefix(l.To, base) && strings.HasPrefix(l.To, "/") { + if strings.HasPrefix(l.To, "/") { l.To = base + l.To } + if !strings.HasPrefix(l.To, base) { + continue + } // drop fragments h := strings.Index(l.To, "#")