Skip to content

Commit aade78b

Browse files
fixed sub-domain filter
1 parent 5c84a6b commit aade78b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sources/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (s *Source) crawlURL(ctx context.Context, seedURL string, chunksChan chan *
162162
// request validations
163163
collector.OnRequest(func(r *colly.Request) {
164164
host := r.URL.Hostname()
165-
if host != parsedURL.Hostname() && !strings.HasSuffix(host, parsedURL.Hostname()) {
165+
if host != parsedURL.Hostname() && !strings.HasSuffix(host, "."+parsedURL.Hostname()) {
166166
ctx.Logger().V(5).Info("blocked by domain filter", "url", r.URL.String())
167167
r.Abort()
168168
}

0 commit comments

Comments
 (0)